-
Notifications
You must be signed in to change notification settings - Fork 20
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
Avoid as much trap as possible in the scheduler #464
Comments
Here's a list of a search for
This should return
This should also just return
These should return
These should return Error::user(Code::InvalidState). User shouldn't be inserting more than one event handler for a given key.
Looking at references to
These should remain trapping, though the user supplies what appears to be the key, the result is dependent on the board implementation.
Think these should also remain trapping being transitively from the above.
These should return
These I'm not sure.
These should return |
Part of #464 --------- Co-authored-by: Julien Cretin <github@ia0.eu>
Thanks for putting up this list (though you could have made a PR directly)! I'll go through them using the
|
Search for all functions returning
Result<_, Trap>
and fix them if needed.Good candidates are:
MemoryApi::alloc()
should returnWorld:NotEnough
(or something similar).Applet::{enable,disable}()
should probably returnUser::InvalidState
.Scheduler::disable_event()
is similar to above.or_trap!()
should be replaced withor_fail!()
.Bad candidates are:
MemoryApi::{get,get_mut}()
) should continue toTrap
.The distinction is not always clear. It would be good to come up with a criteria of whether an operation should trap or error.
This is part of #43.
The text was updated successfully, but these errors were encountered: