From cb0d0ba1cdd1d1a747b50c520807985e1763df8a Mon Sep 17 00:00:00 2001 From: Stream Date: Wed, 3 Apr 2024 16:20:26 +0800 Subject: [PATCH] fix: handle throwable error when uploading --- src/Controllers/UploadController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Controllers/UploadController.php b/src/Controllers/UploadController.php index d1fcc546..b699e79f 100644 --- a/src/Controllers/UploadController.php +++ b/src/Controllers/UploadController.php @@ -41,6 +41,13 @@ public function upload() 'trace' => $e->getTraceAsString() ]); array_push($error_bag, $e->getMessage()); + } catch (\Error $e) { + Log::error($e->getMessage(), [ + 'file' => $e->getFile(), + 'line' => $e->getLine(), + 'trace' => $e->getTraceAsString() + ]); + array_push($error_bag, 'Some error occured during uploading.'); } }