Skip to content

Commit 1fd2418

Browse files
authored
Merge pull request #94 from lavela/master
return of errors
2 parents 03b8d1a + 7da63a9 commit 1fd2418

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PHPJasper.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ public function process(string $input, string $output, array $options = [])
142142
if ($options['resources']) {
143143
$this->command .= " -r {$options['resources']}";
144144
}
145+
146+
$this->command = $this->command . ' 2>&1';
145147
}
146148

147149
return $this;
@@ -216,7 +218,7 @@ public function execute($user = false)
216218
chdir($this->pathExecutable);
217219
exec($this->command, $output, $returnVar);
218220
if ($returnVar !== 0) {
219-
throw new \PHPJasper\Exception\ErrorCommandExecutable();
221+
throw new \Exception("{$output[0]}", 1);
220222
}
221223

222224
return $output;

0 commit comments

Comments
 (0)