Propagate error code if between 400 and 600 for production sites (errors:display = false or -1) (#2181)

This commit is contained in:
Aaron Dalton 2018-11-11 21:22:47 -07:00 committed by Andy Miller
parent d0b34d114d
commit bf86b5a924
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,13 @@ class BareHandler extends Handler
*/
public function handle()
{
$inspector = $this->getInspector();
$code = $inspector->getException()->getCode();
if ( ($code >= 400) && ($code < 600) )
{
$this->getRun()->sendHttpCode($code);
}
return Handler::QUIT;
}

View File

@ -35,6 +35,10 @@ class SimplePageHandler extends Handler
$cssFile = $this->getResource("error.css");
$code = $inspector->getException()->getCode();
if ( ($code >= 400) && ($code < 600) )
{
$this->getRun()->sendHttpCode($code);
}
$message = $inspector->getException()->getMessage();
if ($inspector->getException() instanceof \ErrorException) {