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

Better exception message when loading package fails #229

Merged
merged 3 commits into from
Jun 8, 2023
Merged

Better exception message when loading package fails #229

merged 3 commits into from
Jun 8, 2023

Conversation

johnksv
Copy link
Contributor

@johnksv johnksv commented Jun 7, 2023

Solves issue #228

Previously the stack traces when a package failed to load (due to miscellanies reasons) would not include which package that failed, thus making it hard to debug and fixing the error.
This PR fix this by including the resource description in the stack trace and wrapping the original stack trace.
Se commit message for more details.

Ex stack trace after change (from test):
image

johnksv and others added 3 commits June 7, 2023 17:03
Previously the stack traces when a package failed to load (due to miscellanies reasons) would not include which package that failed, thus making it hard to debug and fixing the error.
This commit fixes this by including the resource description in the stack trace and wrapping the original stack trace.
A test util class for tapping system err is added for the ability to verify the solution, as the exception is just logged and not propagated out of the class.
Coding style is kept as close to the rest of the other files as possible.

Solves issue #228
Small cleanup to make the code more understandable. The relative path is overwritten by the createRelative method in the next call.
@olevitt
Copy link
Contributor

olevitt commented Jun 8, 2023

Very nice, thanks 👍

@olevitt olevitt merged commit 8c383d6 into InseeFrLab:master Jun 8, 2023
@johnksv johnksv deleted the better-stack-trace-error-message branch June 15, 2023 17:06
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