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

Removed calls to unwrap() and expect() #35

Closed
wants to merge 1 commit into from

Conversation

Scipi
Copy link

@Scipi Scipi commented Dec 31, 2020

For issue #33
This removes most calls to .unwrap() and .expect() except in example and test code as well as a handful of cases where we're guaranteed not to fail. Methods that were affected have had their signatures changed to return Result<T, Error>.

I implemented error types with thiserror so it's easy to wrangle together the different kinds of sub-errors that can occur under a common type. A downside here is it's more difficult to annotate certain common failures (like std::io::Error) with custom messages in certain places. It might be worth investigating using snafu in the future to assign contexts to errors, but for now there should be enough information in the errors themselves to describe the different points of failure.

@igiagkiozis
Copy link
Contributor

Please don't send merge requests to master; use dev instead. Read https://github.com/igiagkiozis/plotly/blob/master/CONTRIBUTING.md.

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