Skip to content
Snippets Groups Projects
Unverified Commit ac502407 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Set HTTP status code on response

parent 17af773f
No related branches found
No related tags found
No related merge requests found
...@@ -223,8 +223,6 @@ class Error extends Exception ...@@ -223,8 +223,6 @@ class Error extends Exception
*/ */
public function show(): void public function show(): void
{ {
$this->setHTTPCode();
// log the error message // log the error message
$this->logError(); $this->logError();
...@@ -266,10 +264,12 @@ class Error extends Exception ...@@ -266,10 +264,12 @@ class Error extends Exception
$show_function = $config->getArray('errors.show_function', null); $show_function = $config->getArray('errors.show_function', null);
if (isset($show_function)) { if (isset($show_function)) {
Assert::isCallable($show_function); Assert::isCallable($show_function);
$this->setHTTPCode();
call_user_func($show_function, $config, $data); call_user_func($show_function, $config, $data);
Assert::true(false); Assert::true(false);
} else { } else {
$t = new Template($config, 'error.twig', 'errors'); $t = new Template($config, 'error.twig', 'errors');
$t->setStatusCode($this->httpCode);
$t->data = array_merge($t->data, $data); $t->data = array_merge($t->data, $data);
$t->send(); $t->send();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment