Skip to content

Commit

Permalink
catch exception for not existing blade files. (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbl committed Aug 1, 2020
1 parent 02bb2cf commit ce1b2b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Views/Compilers/BladeSourceMapCompiler.php
Expand Up @@ -2,13 +2,19 @@

namespace Facade\Ignition\Views\Compilers;

use ErrorException;
use Illuminate\View\Compilers\BladeCompiler;

class BladeSourceMapCompiler extends BladeCompiler
{
public function detectLineNumber(string $filename, int $exceptionLineNumber): int
{
$map = $this->compileString(file_get_contents($filename));
try {
$map = $this->compileString(file_get_contents($filename));
} catch (ErrorException $e) {
return 1;
}

$map = explode("\n", $map);

$line = $map[$exceptionLineNumber - 1] ?? $exceptionLineNumber;
Expand Down

0 comments on commit ce1b2b8

Please sign in to comment.