mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Propagate error code if between 400 and 600 for production sites (errors:display = false or -1) (#2181)
This commit is contained in:
parent
d0b34d114d
commit
bf86b5a924
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user