-
-
Notifications
You must be signed in to change notification settings - Fork 675
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 exception handling for Rust #1811
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.
Left a few codestyle comments. Overall I like it, nice!
KeyError(Obj), | ||
AttributeError(Qstr), | ||
ValueError(&'static CStr), | ||
ValueErrorParam(&'static CStr, Obj), | ||
} |
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.
It's a bit unfortunate that this ties the Error
type to MicroPython, and pollutes all the modules with it, but I suppose that a single error type is a bit of a (very convenient) anti-pattern anyway.
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.
true, but it turns out that we don't do basically any error handling within Rust and the Error type is almost always supposed to fall through to uPy
ba2d12c
to
5c09fe5
Compare
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.
Looks great! Will approve after WIP commits are finished. Gonna be a bit tricky to track which upy functions might throw, but still massive improvement over no exception handling.
a4640be
to
63b7936
Compare
chore(core): Add test for Rust exc catching chore(core): Document exception catching in Rust [no changelog]
[no changelog]
[no changelog]
[no changelog]
exclude the None value, because prev_hash is now required on protobuf level unify the parametrization across tests
63b7936
to
036d489
Compare
Builds are failing because in micropython 1.17 the function |
i'll probably hand-call it where needed |
it seems that the Rust unit tests are now broken because symbols are missing: |
My understanding of the problem: previously we did not call any uPy code from unit tests but now we do so we need to link uPy objects to the test binary. I think we need to call
|
The |
Nice, I forgot that the UI branch already had this using |
fixes #1598