mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Consider timeouts a client error
This commit is contained in:
parent
1ca1b548d0
commit
0c4d632dda
3 changed files with 12 additions and 3 deletions
|
@ -26,7 +26,10 @@ impl From<ProcessError> for ExifError {
|
|||
impl ExifError {
|
||||
pub(crate) fn is_client_error(&self) -> bool {
|
||||
// if exiftool bails we probably have bad input
|
||||
matches!(self, Self::CommandFailed(_))
|
||||
matches!(
|
||||
self,
|
||||
Self::CommandFailed(_) | Self::Process(ProcessError::Timeout(_))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,10 @@ impl From<ProcessError> for FfMpegError {
|
|||
impl FfMpegError {
|
||||
pub(crate) fn is_client_error(&self) -> bool {
|
||||
// Failing validation or ffmpeg bailing probably means bad input
|
||||
matches!(self, Self::CommandFailed(_))
|
||||
matches!(
|
||||
self,
|
||||
Self::CommandFailed(_) | Self::Process(ProcessError::Timeout(_))
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn is_not_found(&self) -> bool {
|
||||
|
|
|
@ -59,7 +59,10 @@ impl From<ProcessError> for MagickError {
|
|||
impl MagickError {
|
||||
pub(crate) fn is_client_error(&self) -> bool {
|
||||
// Failing validation or imagemagick bailing probably means bad input
|
||||
matches!(self, Self::CommandFailed(_))
|
||||
matches!(
|
||||
self,
|
||||
Self::CommandFailed(_) | Self::Process(ProcessError::Timeout(_))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue