From 93658ff0ca839352a557bee2599cb5ec8d295d88 Mon Sep 17 00:00:00 2001 From: Volodya Kurshudyan <70023120+xurshudyan@users.noreply.github.com> Date: Mon, 20 May 2024 17:44:58 +0400 Subject: [PATCH] Add MixManifestNotFoundException for better error handling (#51502) Co-authored-by: Xurshudyan --- src/Illuminate/Foundation/Mix.php | 4 ++-- .../Foundation/MixManifestNotFoundException.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/Illuminate/Foundation/MixManifestNotFoundException.php diff --git a/src/Illuminate/Foundation/Mix.php b/src/Illuminate/Foundation/Mix.php index 6c861c72d081..f06deb956e83 100644 --- a/src/Illuminate/Foundation/Mix.php +++ b/src/Illuminate/Foundation/Mix.php @@ -15,7 +15,7 @@ class Mix * @param string $manifestDirectory * @return \Illuminate\Support\HtmlString|string * - * @throws \Exception + * @throws \Illuminate\Foundation\MixManifestNotFoundException */ public function __invoke($path, $manifestDirectory = '') { @@ -49,7 +49,7 @@ public function __invoke($path, $manifestDirectory = '') if (! isset($manifests[$manifestPath])) { if (! is_file($manifestPath)) { - throw new Exception("Mix manifest not found at: {$manifestPath}"); + throw new MixManifestNotFoundException("Mix manifest not found at: {$manifestPath}"); } $manifests[$manifestPath] = json_decode(file_get_contents($manifestPath), true); diff --git a/src/Illuminate/Foundation/MixManifestNotFoundException.php b/src/Illuminate/Foundation/MixManifestNotFoundException.php new file mode 100644 index 000000000000..9931be1216ef --- /dev/null +++ b/src/Illuminate/Foundation/MixManifestNotFoundException.php @@ -0,0 +1,10 @@ +