-
Notifications
You must be signed in to change notification settings - Fork 55
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
Implement error handling #47
Implement error handling #47
Conversation
The bad_svd test is currently used to see how errors are made.
Also removed tests unrelated to svdparser
This has changed how parsing is done. All parsing is done in that "modules" _parse function and mapping of errors are done in parse. This allows us to wrap every possible source of failure and apply a context to it. Also fixed `RegisterClusterArrayInfo::dim_index` where `and_then_result` could have been used
Also updgraded failure to 0.1.1
There is a problem somewhere, as the PeripheralError in `register_name_missing` doesn't seem to have a cause. Also, we have to match differently when we are nested deeper with a named peripheral. May have to ultimately just have one error for named and unnamed peripherals/register/etc and implement the display differently depending on name: Option<String>
I'm not 💯 on implementing errors yet, but would the solution to match be to expose an |
This may all be due to bad usage of I am currently looking into implementing |
Work is being reimplemented in the refactor branch |
This PR adds error handling via
failure
. This implementation does however need some work on it as the generated errors doesn't seem matchable in it's current state.TODO
fn(...) -> Result<_,Error>
intofn(...) -> Result<_,FnSpecificError>
This should fix item 2, but I'm not sure.
Part of #46 and #18