From 8ad60f6ec5335ffa78149da03b66605ecc82a398 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 30 Oct 2021 21:45:12 +0200 Subject: [PATCH] Add failed routine to ResizeJob --- classes/ResizeJob.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/classes/ResizeJob.php b/classes/ResizeJob.php index ae9897c..3386724 100644 --- a/classes/ResizeJob.php +++ b/classes/ResizeJob.php @@ -3,6 +3,8 @@ namespace Aweos\Resizer\Classes; use Aweos\Resizer\Lib\MediaPath; +use Log; +use Throwable; class ResizeJob { @@ -12,4 +14,15 @@ class ResizeJob list($file) = $params; app(ImageResizer::class)->generate(new MediaPath($file)); } + + public function failed($data, Throwable $e) + { + Log::error("Resizing of image failed", [ + 'message' => $e->getMessage(), + 'exception' => $e, + 'data' => $data, + ]); + + throw $e; + } }