If suppressExceptions is true, it will suppress the ImagerException here:
|
try { |
|
if (!isset(self::$transformers[self::$transformConfig->transformer])) { |
|
Craft::error('Invalid transformer "'.self::$transformConfig->transformer.'"', __METHOD__); |
|
throw new ImagerException('Invalid transformer "'.self::$transformConfig->transformer.'"'); |
|
} |
|
|
|
/** @var TransformerInterface $transformer */ |
|
$transformer = new self::$transformers[self::$transformConfig->transformer](); |
|
$transformedImages = $transformer->transform($image, $transforms); |
|
} catch (ImagerException $e) { |
|
if (self::$transformConfig->suppressExceptions) { |
|
return null; |
|
} |
|
|
|
throw $e; |
|
} |
However, my code is throwing an AssetException here, which is not getting caught here, and I cannot suppress it.
In my staging environment, my assets are not synced up with production, but I am using a production database copy... so sometime images do not exist. My twig templates are doing some really weird things, breaking when an image is not available and imager.transformImage is called. I need to be able to suppress these Exceptions.
This is related to this issue as well (#298), which is making setting suppressExceptions pointless in devMode.
If
suppressExceptionsis true, it will suppress the ImagerException here:Imager-Craft/src/services/ImagerService.php
Lines 330 to 345 in b9f01d7
However, my code is throwing an AssetException here, which is not getting caught here, and I cannot suppress it.
In my staging environment, my assets are not synced up with production, but I am using a production database copy... so sometime images do not exist. My twig templates are doing some really weird things, breaking when an image is not available and imager.transformImage is called. I need to be able to suppress these Exceptions.
This is related to this issue as well (#298), which is making setting suppressExceptions pointless in devMode.