Skip to content

Commit 51b0584

Browse files
committed
Don't panic on SerializationFailure | InternalFailure while getting property
Signed-off-by: Alex Snaps <[email protected]>
1 parent 427bea0 commit 51b0584

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/hostcalls.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,10 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
414414
} else {
415415
Ok(None)
416416
}
417-
}
417+
},
418418
Status::NotFound => Ok(None),
419+
Status::SerializationFailure => Err(Status::SerializationFailure),
420+
Status::InternalFailure => Err(Status::InternalFailure),
419421
status => panic!("unexpected status: {}", status as u32),
420422
}
421423
}

src/types.rs

-5
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,9 @@ pub enum Status {
4646
BadArgument = 2,
4747
SerializationFailure = 3,
4848
ParseFailure = 4,
49-
BadExpression = 5,
50-
InvalidMemoryAccess = 6,
5149
Empty = 7,
5250
CasMismatch = 8,
53-
ResultMismatch = 9,
5451
InternalFailure = 10,
55-
BrokenConnection = 11,
56-
Unimplemented = 12,
5752
}
5853

5954
#[repr(u32)]

0 commit comments

Comments
 (0)