File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1313// limitations under the License.
1414
1515use crate :: dispatcher;
16+ use crate :: types:: Status :: SerializationFailure ;
1617use crate :: types:: * ;
1718use std:: ptr:: { null, null_mut} ;
1819use std:: time:: { Duration , SystemTime , UNIX_EPOCH } ;
@@ -398,12 +399,13 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
398399 let mut return_data: * mut u8 = null_mut ( ) ;
399400 let mut return_size: usize = 0 ;
400401 unsafe {
401- match proxy_get_property (
402+ let status = proxy_get_property (
402403 serialized_path. as_ptr ( ) ,
403404 serialized_path. len ( ) ,
404405 & mut return_data,
405406 & mut return_size,
406- ) {
407+ ) ;
408+ match status {
407409 Status :: Ok => {
408410 if !return_data. is_null ( ) {
409411 Ok ( Some ( Vec :: from_raw_parts (
@@ -415,8 +417,12 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
415417 Ok ( None )
416418 }
417419 }
418- Status :: NotFound => Ok ( None ) ,
419- status => Err ( status) ,
420+ Status :: NotFound | Status :: Empty => Ok ( None ) ,
421+ Status :: SerializationFailure
422+ | Status :: BadArgument
423+ | Status :: BadExpression
424+ | Status :: Unimplemented => Err ( status) ,
425+ status => panic ! ( "unexpected status: {}" , status as u32 ) ,
420426 }
421427 }
422428}
You can’t perform that action at this time.
0 commit comments