Skip to content

Commit f0dd017

Browse files
committed
Implementação do retorno de erros
1 parent 03b8d1a commit f0dd017

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PHPJasper.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ public function process(string $input, string $output, array $options = [])
140140
}
141141

142142
if ($options['resources']) {
143-
$this->command .= " -r {$options['resources']}";
143+
$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)