Skip to content

Commit

Permalink
Don't panic on SerializationFailure | InternalFailure while getting p…
Browse files Browse the repository at this point in the history
…roperty

Signed-off-by: Alex Snaps <alex@wcgw.dev>
  • Loading branch information
alexsnaps committed Jul 3, 2024
1 parent 427bea0 commit 51b0584
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/hostcalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,10 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
} else {
Ok(None)
}
}
},
Status::NotFound => Ok(None),
Status::SerializationFailure => Err(Status::SerializationFailure),
Status::InternalFailure => Err(Status::InternalFailure),
status => panic!("unexpected status: {}", status as u32),
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ pub enum Status {
BadArgument = 2,
SerializationFailure = 3,
ParseFailure = 4,
BadExpression = 5,
InvalidMemoryAccess = 6,
Empty = 7,
CasMismatch = 8,
ResultMismatch = 9,
InternalFailure = 10,
BrokenConnection = 11,
Unimplemented = 12,
}

#[repr(u32)]
Expand Down

0 comments on commit 51b0584

Please sign in to comment.