Skip to content

Commit 1fa7f9f

Browse files
committed
Add error logs for asset-uploads
1 parent 610a1e7 commit 1fa7f9f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/Service.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ public function beforeHandleAssetFile(AssetEvent $event)
2929
$path = $asset->tempFilePath;
3030

3131
if (!$path) {
32+
ImageResizer::$plugin->logs->resizeLog(null, 'error', $filename, ['message' => 'Unable to find path: ' . $path]);
33+
3234
return;
3335
}
3436

3537
// Because this is fired on the before-save event, and validation hasn't kicked in yet
3638
// we check it here. Otherwise, we potentially process it twice when there's a conflict.
3739
if (!$asset->validate()) {
40+
ImageResizer::$plugin->logs->resizeLog(null, 'error', $filename, ['message' => json_encode($asset->getErrors())]);
41+
3842
return;
3943
}
4044

0 commit comments

Comments
 (0)