feat: add user-friendly error messages#437
Merged
bishoy-at-pieces merged 3 commits intopieces-app:mainfrom Jan 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a user-friendly error handling system to transform cryptic error messages into helpful, actionable guidance for CLI users. The changes include a new errors module with pattern-based error matching and user-friendly formatting, integration into the existing error handling paths, and comprehensive test coverage.
- Introduces
UserFriendlyErrordataclass andErrorCategoryenum for structured error representation - Implements pattern-based error matching for 13+ error scenarios including connection, authentication, permissions, timeouts, and more
- Updates
app.pyandsettings.pyto use the new error formatting system
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pieces/errors/init.py | Exports the public API of the new errors module |
| src/pieces/errors/user_friendly.py | Core implementation with error patterns, matching logic, and formatting |
| src/pieces/app.py | Updates main exception handler to use user-friendly error formatting |
| src/pieces/settings.py | Updates show_error method to handle both Exception objects and string errors with user-friendly formatting |
| tests/test_user_friendly_errors.py | Comprehensive test suite with 19 tests covering error categorization and formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…re pattern matching - use getattr for safer errno access - remove unused EXCEPTION_HANDLERS code
bishoy-at-pieces
previously approved these changes
Jan 10, 2026
Collaborator
bishoy-at-pieces
left a comment
There was a problem hiding this comment.
Super solid thank you so much
Just small change needed
Replace hardcoded documentation URLs with references to the URLs enum class as requested by maintainer. This ensures URLs are centralized and can be updated in one place.
bishoy-at-pieces
approved these changes
Jan 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Transforms cryptic error messages into helpful guidance. Instead of showing users raw exceptions like
WebSocket connection failed: [Errno 61] Connection refused, they now see what went wrong, why it might have happened, and what to try.Example
Before:
Error: WebSocket connection failed: [Errno 61] Connection refusedAfter:
Changes:
Fixes #379