File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
use crate :: dispatcher;
16
+ use crate :: types:: Status :: SerializationFailure ;
16
17
use crate :: types:: * ;
17
18
use std:: ptr:: { null, null_mut} ;
18
19
use std:: time:: { Duration , SystemTime , UNIX_EPOCH } ;
@@ -398,12 +399,13 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
398
399
let mut return_data: * mut u8 = null_mut ( ) ;
399
400
let mut return_size: usize = 0 ;
400
401
unsafe {
401
- match proxy_get_property (
402
+ let status = proxy_get_property (
402
403
serialized_path. as_ptr ( ) ,
403
404
serialized_path. len ( ) ,
404
405
& mut return_data,
405
406
& mut return_size,
406
- ) {
407
+ ) ;
408
+ match status {
407
409
Status :: Ok => {
408
410
if !return_data. is_null ( ) {
409
411
Ok ( Some ( Vec :: from_raw_parts (
@@ -415,8 +417,12 @@ pub fn get_property(path: Vec<&str>) -> Result<Option<Bytes>, Status> {
415
417
Ok ( None )
416
418
}
417
419
}
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 ) ,
420
426
}
421
427
}
422
428
}
You can’t perform that action at this time.
0 commit comments