mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -04:00
Use HTTP code enums instead of ints
This commit is contained in:
parent
3f822b85c3
commit
3050ab7219
28 changed files with 56 additions and 56 deletions
|
@ -56,7 +56,7 @@ catch(Exceptions\EbookNotFoundException){
|
|||
$ebook = Ebook::GetByIdentifierStartingWith($identifier);
|
||||
|
||||
// Found, redirect.
|
||||
http_response_code(301);
|
||||
http_response_code(Enums\HttpCode::MovedPermanently->value);
|
||||
header('Location: ' . $ebook->Url);
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ catch(Exceptions\PageOutOfBoundsException){
|
|||
}
|
||||
catch(Exceptions\AppException $ex){
|
||||
// Something very unexpected happened, log and emit 500.
|
||||
http_response_code(500); // Internal server error.
|
||||
http_response_code(Enums\HttpCode::InternalServerError->value); // Internal server error.
|
||||
Log::WriteErrorLogEntry($ex);
|
||||
exit();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue