File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -872,19 +872,23 @@ fn stream_timestamp(
872872 let ts = status. get_htstamp ( ) ;
873873 let nanos = timespec_diff_nanos ( ts, trigger_ts) ;
874874 if nanos < 0 {
875- panic ! (
875+ let description = format ! (
876876 "get_htstamp `{}.{}` was earlier than get_trigger_htstamp `{}.{}`" ,
877877 ts. tv_sec, ts. tv_nsec, trigger_ts. tv_sec, trigger_ts. tv_nsec
878878 ) ;
879+ return Err ( BackendSpecificError { description } ) ;
879880 }
880881 Ok ( crate :: StreamInstant :: from_nanos ( nanos) )
881882 }
882883 Some ( creation) => {
883884 let now = std:: time:: Instant :: now ( ) ;
884885 let duration = now. duration_since ( creation) ;
885- let instant = crate :: StreamInstant :: from_nanos_i128 ( duration. as_nanos ( ) as i128 )
886- . expect ( "stream duration has exceeded `StreamInstant` representation" ) ;
887- Ok ( instant)
886+ crate :: StreamInstant :: from_nanos_i128 ( duration. as_nanos ( ) as i128 ) . ok_or (
887+ BackendSpecificError {
888+ description : "stream duration has exceeded `StreamInstant` representation"
889+ . to_string ( ) ,
890+ } ,
891+ )
888892 }
889893 }
890894}
You can’t perform that action at this time.
0 commit comments