Skip to content

Commit

Permalink
Implement exit_on_error option
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Mar 29, 2018
1 parent db22d7d commit afb9959
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Phug/Renderer/Partial/AdapterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ private function handleHtmlEvent(HtmlEvent $htmlEvent, array $parameters, $path,
if ($error = $htmlEvent->getError()) {
$this->handleError($error, 1, $path, $getSource(), $parameters, [
'debug' => $this->getOption('debug'),
'exit_on_error' => $this->getOption('exit_on_error'),
'error_handler' => $this->getOption('error_handler'),
'html_error' => $this->getOption('html_error'),
'error_context_lines' => $this->getOption('error_context_lines'),
Expand Down
2 changes: 1 addition & 1 deletion src/Phug/Renderer/Partial/Debug/DebuggerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public function handleError($error, $code, $path, $source, $parameters, $options
$handler = $options['error_handler'];
if (!$handler) {
// @codeCoverageIgnoreStart
if ($options['debug']) {
if ($options['debug'] && $options['exit_on_error']) {
if ($options['html_error']) {
echo $exception->getMessage();
exit(1);
Expand Down
1 change: 1 addition & 0 deletions src/Phug/Renderer/Partial/RendererOptionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ protected function getDefaultOptions($options)
{
return [
'debug' => true,
'exit_on_error' => true,
'enable_profiler' => false,
'up_to_date_check' => true,
'keep_base_name' => false,
Expand Down

0 comments on commit afb9959

Please sign in to comment.