log errors and set $success to false

This commit is contained in:
Uwe Steinmann 2024-03-27 19:49:52 +01:00
parent a05a0b9b49
commit 6b91d3ce40
2 changed files with 18 additions and 0 deletions

View File

@ -67,8 +67,18 @@ class SeedDMS_ConversionServiceImageToImage extends SeedDMS_ConversionServiceBas
} else { } else {
return $imagick->getImageBlob(); return $imagick->getImageBlob();
} }
} else {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with image service failed: could not read input file.', PEAR_LOG_ERR);
}
$this->success = false;
return false;
} }
} catch (ImagickException $e) { } catch (ImagickException $e) {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with image service failed: '.$e->getMessage(), PEAR_LOG_ERR);
}
$this->success = false;
return false; return false;
} }
} elseif(extension_loaded('gd')) { } elseif(extension_loaded('gd')) {
@ -102,6 +112,10 @@ class SeedDMS_ConversionServiceImageToImage extends SeedDMS_ConversionServiceBas
return $image; return $image;
} }
} else { } else {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with image service failed: could not read input file.', PEAR_LOG_ERR);
}
$this->success = false;
return false; return false;
} }
} }

View File

@ -83,6 +83,10 @@ class SeedDMS_ConversionServicePdfToImage extends SeedDMS_ConversionServiceBase
} else { } else {
return $imagick->getImageBlob(); return $imagick->getImageBlob();
} }
} else {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with pdf service failed: could not read input file.', PEAR_LOG_ERR);
}
} }
} catch (ImagickException $e) { } catch (ImagickException $e) {
if($this->logger) { if($this->logger) {