mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 01:50:24 -05:00
improve error msg on timeout opening stream
Before, it'd look like the following, as mentioned in https://github.com/scottlamb/moonfire-nvr/issues/331: ``` 2024-12-09T20:53:24.853572 WARN s-CP3PRO-main streamer{stream="CP3PRO-main"}: moonfire_nvr::streamer: sleeping for 1 s after error err=UNKNOWN caused by: deadline has elapsed ``` ...which isn't as clear as it could be, particularly if you don't notice the `caused by` bit. After, it should look more like the following: ``` 2024-12-09T20:53:24.853572 WARN s-CP3PRO-main streamer{stream="CP3PRO-main"}: moonfire_nvr::streamer: sleeping for 1 s after error err=DEADLINE_EXCEEDED unable to play stream and get first frame within PT30S caused by: deadline has elapsed ```
This commit is contained in:
@@ -111,7 +111,13 @@ impl Opener for RealOpener {
|
||||
),
|
||||
)
|
||||
.expect("RetinaStream::play task panicked, see earlier error")
|
||||
.map_err(|e| err!(Unknown, source(e)))??;
|
||||
.map_err(|e| {
|
||||
err!(
|
||||
DeadlineExceeded,
|
||||
msg("unable to play stream and get first frame within {RETINA_TIMEOUT:?}"),
|
||||
source(e),
|
||||
)
|
||||
})??;
|
||||
Ok(Box::new(RetinaStream {
|
||||
inner: Some(inner),
|
||||
rt_handle,
|
||||
@@ -302,7 +308,7 @@ impl Stream for RetinaStream {
|
||||
.map_err(|e| {
|
||||
err!(
|
||||
DeadlineExceeded,
|
||||
msg("timeout getting next frame"),
|
||||
msg("unable to get next frame within {RETINA_TIMEOUT:?}"),
|
||||
source(e)
|
||||
)
|
||||
})??;
|
||||
|
||||
Reference in New Issue
Block a user