Use constant for HTTP response code
This commit is contained in:
parent
359c358df1
commit
5ed15afe1f
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Alltube;
|
namespace Alltube;
|
||||||
|
|
||||||
|
use Slim\Http\StatusCode;
|
||||||
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
|
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ class ErrorHandler
|
||||||
http_response_code($exception->getStatusCode());
|
http_response_code($exception->getStatusCode());
|
||||||
die($exception->getAsString());
|
die($exception->getAsString());
|
||||||
} else {
|
} else {
|
||||||
http_response_code(500);
|
http_response_code(StatusCode::HTTP_INTERNAL_SERVER_ERROR);
|
||||||
die('Error when starting the app: ' . htmlentities($e->getMessage()));
|
die('Error when starting the app: ' . htmlentities($e->getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue