Use constant for HTTP response code

This commit is contained in:
Pierre Rudloff 2022-01-26 23:58:25 +01:00
parent 359c358df1
commit 5ed15afe1f

View file

@ -2,6 +2,7 @@
namespace Alltube;
use Slim\Http\StatusCode;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Throwable;
@ -29,7 +30,7 @@ class ErrorHandler
http_response_code($exception->getStatusCode());
die($exception->getAsString());
} else {
http_response_code(500);
http_response_code(StatusCode::HTTP_INTERNAL_SERVER_ERROR);
die('Error when starting the app: ' . htmlentities($e->getMessage()));
}
}