2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 03:11:24 +00:00

Consider timeouts a client error

This commit is contained in:
asonix 2023-08-05 16:18:06 -05:00
parent 1ca1b548d0
commit 0c4d632dda
3 changed files with 12 additions and 3 deletions

View file

@ -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(_))
)
}
}

View file

@ -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 {

View file

@ -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(_))
)
}
}