Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve err message #236

Merged
merged 4 commits into from
Nov 11, 2022
Merged

fix: improve err message #236

merged 4 commits into from
Nov 11, 2022

Conversation

ChaoticTempest
Copy link
Member

based on #232

Adds in the sandbox error improvement

Copy link
Contributor

@austinabell austinabell left a comment

Choose a reason for hiding this comment

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

TIL about the source attribute

Comment on lines +41 to +47
#[error("{kind}")]
Custom {
kind: ErrorKind,
#[source]
error: Box<dyn std::error::Error + Send + Sync>,
},
#[error("{message}: {error}")]
#[error("{message}")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious in these why for Custom the error is not included in this message (does source automatically include it?), and for Full, why the error kind is ignored

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, #[source] creates a chain of error message when you go to display it. For full, didn't see a need to include it since the error message should for the most part tell you what kind of class of errors it it. Normally I don't think kind is that useful in error messages unless there's no other context to the error

@ChaoticTempest
Copy link
Member Author

hmm, looks like 4.1.1 breaks compile_project. Using =4.0.0 fixes things but error messages aren't saying much

@austinabell
Copy link
Contributor

Using =4.0.0 fixes things but error messages aren't saying much

Prob worth opening an issue for that. The error message was in the output, but that was very cryptic to read

@ChaoticTempest ChaoticTempest merged commit 48d050d into main Nov 11, 2022
@ChaoticTempest ChaoticTempest deleted the fix/improve-err-message branch November 11, 2022 00:08
@frol frol mentioned this pull request Oct 4, 2023
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.

3 participants