From 68d4f38e319da9d1353d59a614723f3de14bc50f Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Thu, 10 Nov 2022 15:02:13 +0100 Subject: [PATCH] fixed: throw exception --- src/BaseCompiler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BaseCompiler.php b/src/BaseCompiler.php index 4abbcc9..abac33f 100644 --- a/src/BaseCompiler.php +++ b/src/BaseCompiler.php @@ -25,6 +25,12 @@ abstract class BaseCompiler implements Responsable } exec($this->command($document), $output, $returnVar); + + if (0 !== $returnVar) { + Log::error('Compilation failed', ['body' => $contents, 'output' => $output, 'dir' => $this->file->getPath(), 'command' => $this->command($document)]); + throw (new CompilerException('Compilation failed.'))->setOutput($output); + } + $this->refreshFile(); if (!$this->file->isFile()) {