Skip to content

Commit

Permalink
Add MixManifestNotFoundException for better error handling (#51502)
Browse files Browse the repository at this point in the history
Co-authored-by: Xurshudyan <[email protected]>
  • Loading branch information
xurshudyan and Xurshudyan authored May 20, 2024
1 parent 3b70842 commit 93658ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Mix.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '')
{
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Foundation/MixManifestNotFoundException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Illuminate\Foundation;

use Exception;

class MixManifestNotFoundException extends Exception
{
//
}

0 comments on commit 93658ff

Please sign in to comment.