Skip to content

refactor!: add back Error trait#24

Closed
tisonkun wants to merge 5 commits into
mainfrom
error-trait
Closed

refactor!: add back Error trait#24
tisonkun wants to merge 5 commits into
mainfrom
error-trait

Conversation

@tisonkun

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: tison <wander4096@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the error handling system by introducing a custom Error trait that wraps std::error::Error + Send + Sync + 'static and provides a convenient raise method. This consolidates the trait bounds used throughout the codebase.

Changes:

  • Introduces a new Error trait in lib.rs with a blanket implementation and a raise helper method
  • Replaces all occurrences of std::error::Error + 'static with the custom Error trait
  • Updates imports across all modules to use crate::Error instead of std::error::Error
  • Adjusts documentation links and example line numbers to reflect the import changes

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
exn/src/lib.rs Adds the new Error trait with blanket implementation and updates the Ok function signature
exn/src/impls.rs Updates Exn and Frame to use the custom Error trait and fixes documentation links
exn/src/result.rs Updates ResultExt trait bounds to use the custom Error trait
exn/src/option.rs Updates import to use the custom Error trait
exn/src/display.rs Updates import to use the custom Error trait
exn/src/debug.rs Updates import to use the custom Error trait
examples/src/downcast.rs Updates import and adjusts line numbers in output comments
examples/src/custom-layout.rs Updates import to use the custom Error trait

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exn/src/lib.rs Outdated
Comment thread exn/src/impls.rs Outdated
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun

Copy link
Copy Markdown
Contributor Author

Closed in favor of considering #20.

@tisonkun tisonkun closed this Jan 15, 2026
@tisonkun tisonkun deleted the error-trait branch January 16, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants