Skip to content

Commit

Permalink
Update store errors mapping (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 authored May 17, 2024
1 parent 8318ea7 commit ac32ec7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/scheduler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

### Patch

- Update `store` errors mapping
- Use explicit conversion from `Error` to `Trap`
- Simplify `#[cfg(all)]` attributes between board and applet features
- Update dependencies
Expand Down
6 changes: 3 additions & 3 deletions crates/scheduler/src/call/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ fn clear<B: Board>(mut call: SchedulerCall<B, api::clear::Sig>) {
#[cfg(feature = "board-api-storage")]
fn convert(err: StoreError) -> Error {
match err {
StoreError::InvalidArgument => Error::user(0),
StoreError::NoCapacity | StoreError::NoLifetime => Error::user(Code::NotEnough),
StoreError::StorageError => Error::world(0),
StoreError::InvalidArgument => Error::user(Code::InvalidArgument),
StoreError::NoCapacity | StoreError::NoLifetime => Error::world(Code::NotEnough),
StoreError::StorageError => Error::world(Code::Generic),
StoreError::InvalidStorage => Error::world(Code::InvalidState),
}
}

0 comments on commit ac32ec7

Please sign in to comment.