2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-11-20 11:21:14 +00:00

Consider timeout errors client errors

This commit is contained in:
asonix 2023-08-05 15:15:20 -05:00
parent 04bf9aade7
commit d32f61b85e
3 changed files with 16 additions and 7 deletions

View file

@ -14,7 +14,10 @@ pub(crate) enum ExifError {
impl ExifError {
pub(crate) fn is_client_error(&self) -> bool {
// if exiftool bails we probably have bad input
matches!(self, Self::Process(ProcessError::Status(_)))
matches!(
self,
Self::Process(ProcessError::Status(_) | ProcessError::Timeout)
)
}
}

View file

@ -119,9 +119,12 @@ pub(crate) enum FfMpegError {
impl FfMpegError {
pub(crate) fn is_client_error(&self) -> bool {
// Failing validation or ffmpeg bailing probably means bad input
matches!(self, Self::ValidateDetails(_))
|| matches!(self, Self::Process(ProcessError::Status(_)))
|| matches!(self, Self::Empty)
matches!(
self,
Self::ValidateDetails(_)
| Self::Process(ProcessError::Status(_) | ProcessError::Timeout)
| Self::Empty
)
}
pub(crate) fn is_not_found(&self) -> bool {

View file

@ -55,9 +55,12 @@ pub(crate) enum MagickError {
impl MagickError {
pub(crate) fn is_client_error(&self) -> bool {
// Failing validation or imagemagick bailing probably means bad input
matches!(self, Self::ValidateDetails(_))
|| matches!(self, Self::Process(ProcessError::Status(_)))
|| matches!(self, Self::Empty)
matches!(
self,
Self::ValidateDetails(_)
| Self::Process(ProcessError::Status(_) | ProcessError::Timeout)
| Self::Empty
)
}
pub(crate) fn is_not_found(&self) -> bool {