Skip to content

Commit be3378c

Browse files
committed
Core: Log errors as errors
1 parent e27e941 commit be3378c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PHPDraft/Parse/BaseParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function parseToJson()
7272

7373
if (json_last_error() !== JSON_ERROR_NONE)
7474
{
75-
file_put_contents('php://stdout', 'ERROR: invalid json in ' . $this->tmp_dir . '/index.json');
75+
file_put_contents('php://stderr', 'ERROR: invalid json in ' . $this->tmp_dir . '/index.json');
7676
throw new \RuntimeException('Drafter generated invalid JSON (' . json_last_error_msg() . ')', 2);
7777
}
7878

@@ -82,6 +82,7 @@ public function parseToJson()
8282
$warnings = true;
8383
$prefix = strtoupper($item->meta->classes[0]);
8484
$error = $item->content;
85+
file_put_contents('php://stderr', "$prefix: $error\n");
8586
file_put_contents('php://stdout', "<pre>$prefix: $error</pre>\n");
8687
}
8788
}

0 commit comments

Comments
 (0)