Skip to content

Commit

Permalink
[11.x] Introduce MixFileNotFoundException for handling missing Mix fi…
Browse files Browse the repository at this point in the history
…les (#52400)

* Add MixFileNotFoundException for better error handling

* Update MixFileNotFoundException.php

* Update MixFileNotFoundException.php

---------

Co-authored-by: Ihor Vereshchynskyi <ihor@hicaliber.com.au>
Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
3 people authored Aug 6, 2024
1 parent 64c45e0 commit 5e5cbc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Illuminate/Foundation/Mix.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Illuminate\Foundation;

use Exception;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;

Expand All @@ -15,7 +14,7 @@ class Mix
* @param string $manifestDirectory
* @return \Illuminate\Support\HtmlString|string
*
* @throws \Illuminate\Foundation\MixManifestNotFoundException
* @throws \Illuminate\Foundation\MixManifestNotFoundException|\Illuminate\Foundation\MixFileNotFoundException
*/
public function __invoke($path, $manifestDirectory = '')
{
Expand Down Expand Up @@ -58,7 +57,7 @@ public function __invoke($path, $manifestDirectory = '')
$manifest = $manifests[$manifestPath];

if (! isset($manifest[$path])) {
$exception = new Exception("Unable to locate Mix file: {$path}.");
$exception = new MixFileNotFoundException("Unable to locate Mix file: {$path}.");

if (! app('config')->get('app.debug')) {
report($exception);
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Foundation/MixFileNotFoundException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Illuminate\Foundation;

use Exception;

class MixFileNotFoundException extends Exception
{
//
}

0 comments on commit 5e5cbc7

Please sign in to comment.