-
Notifications
You must be signed in to change notification settings - Fork 78
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 error handling, pattern matching instead of conditional flow #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! I've added a few more comments, it would be great if you could address those as well (sorry for missing the problem in the tests in my last review)
Did you intentionally or accidentially close this PR? If the former, would you be ok if we used your changes as a base for a new PR? |
Hey, intentionally because of the mess I made there haha. I am on track of redesigning my previous logic into something better. I will make a new PR today in the evening. Sounds good? |
Sounds good 👍 |
Description
Improved error handling and exhaustive handling of all the possible error codes. In original implementation only two variants of enum were handled in conditional manner (which is not robust in this case). The proposed usage of pattern matching via "match" case is a better way of handling errors. I have proposed a new enum variant for an Error that returns the standardized error code instead.
Let me know if there are any further suggestions for improvement.
Checklist
cargo fmt --all
cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features use-serde,derive,reqwest-client -- -D warnings
cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features use-serde,derive,hyper-client -- -D warnings
cargo doc2readme -p influxdb --expand-macros