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

Lessen amount of panics #59

Merged
merged 5 commits into from
Aug 30, 2023
Merged

Lessen amount of panics #59

merged 5 commits into from
Aug 30, 2023

Conversation

hasezoey
Copy link
Collaborator

This PR changes to use Result wherever possible and so lessen the amount of panic!, unwrap and expects

re #56

should feature backtrace maybe be a default?

Copy link
Owner

@Wulf Wulf left a comment

Choose a reason for hiding this comment

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

@hasezoey, this looks good to me but I agree -- we should make backtrace a default feature

@hasezoey
Copy link
Collaborator Author

hasezoey commented Aug 23, 2023

rebased because i noticed some problems. mainly that the function was get_backtrace() and not backtrace(), also that the main function returned anyhow::Result instead of the actual Result

PS: also removed anyhow because it is not in use anymore

@hasezoey
Copy link
Collaborator Author

rebased on latest main

@hasezoey hasezoey requested a review from Wulf August 28, 2023 10:02
Copy link
Owner

@Wulf Wulf left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me 👍

@Wulf
Copy link
Owner

Wulf commented Aug 29, 2023

Feel free to merge this in, but if you have the time, I'd love to remove the 'backtrace' feature flag and just make it the default (no feature checks)

@hasezoey
Copy link
Collaborator Author

Feel free to merge this in, but if you have the time, I'd love to remove the 'backtrace' feature flag and just make it the default (no feature checks)

i have it made behind a feature flag that so that if the library part is used it can be configured, also because backtrace for errors is not quite standardized yet, see:

this includes "panic!" and "expect" and some "unwrap"

feat(lib): replace panics with results
feat(parser): replace panics with results
feat(file): replace panics with results
@hasezoey hasezoey merged commit 22b795f into Wulf:main Aug 30, 2023
3 checks passed
@hasezoey hasezoey deleted the nopanic branch August 30, 2023 10:34
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