X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/02dc3154e34775f44b4f38b525224a2354aa698c..refs/pull/2768/head:/app/Http/Controllers/Images/ImageController.php diff --git a/app/Http/Controllers/Images/ImageController.php b/app/Http/Controllers/Images/ImageController.php index 7d06facff..1eb8917b3 100644 --- a/app/Http/Controllers/Images/ImageController.php +++ b/app/Http/Controllers/Images/ImageController.php @@ -1,14 +1,12 @@ image = $image; $this->file = $file; $this->imageRepo = $imageRepo; - parent::__construct(); } /** * Provide an image file from storage. + * @throws NotFoundException */ public function showImage(string $path) { $path = storage_path('uploads/images/' . $path); if (!file_exists($path)) { - abort(404); + throw (new NotFoundException(trans('errors.image_not_found'))) + ->setSubtitle(trans('errors.image_not_found_subtitle')) + ->setDetails(trans('errors.image_not_found_details')); } return response()->file($path);