Skip to content

Commit fdf5bef

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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/hostcalls.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::dispatcher;
1616
use crate::types::*;
1717
use std::ptr::{null, null_mut};
1818
use std::time::{Duration, SystemTime, UNIX_EPOCH};
19+
use crate::types::LogLevel::Error;
1920

2021
extern "C" {
2122
fn proxy_log(level: LogLevel, message_data: *const u8, message_size: usize) -> Status;
@@ -414,8 +415,9 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
414415
} else {
415416
Ok(None)
416417
}
417-
}
418-
Status::NotFound => Ok(None),
418+
},
419+
Status::SerializationFailure => Err(Status::SerializationFailure),
420+
Status::InternalFailure => Err(Status::InternalFailure),
419421
status => panic!("unexpected status: {}", status as u32),
420422
}
421423
}

0 commit comments

Comments
 (0)