Avoid as much trap as possible in the scheduler #464
Labels
crate:scheduler
Modifies the platform
for:usability
Improves users (and maintainers) life
needs:implementation
Needs implementation to complete
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: