mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 01:22:23 -04:00
Fix some exception logic
This commit is contained in:
parent
fcca4fc417
commit
4574b55cac
1 changed files with 2 additions and 5 deletions
|
@ -1,7 +1,5 @@
|
||||||
<?
|
<?
|
||||||
|
|
||||||
use Exceptions\InvalidImageUploadException;
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
session_start();
|
session_start();
|
||||||
$httpMethod = HttpInput::ValidateRequestMethod([HttpMethod::Post, HttpMethod::Patch, HttpMethod::Put]);
|
$httpMethod = HttpInput::ValidateRequestMethod([HttpMethod::Post, HttpMethod::Patch, HttpMethod::Put]);
|
||||||
|
@ -126,11 +124,10 @@ catch(Exceptions\InvalidPermissionsException){
|
||||||
catch(Exceptions\ArtworkNotFoundException){
|
catch(Exceptions\ArtworkNotFoundException){
|
||||||
Template::Emit404();
|
Template::Emit404();
|
||||||
}
|
}
|
||||||
catch(Exceptions\InvalidArtworkException | Exceptions\InvalidArtworkTagException | Exceptions\InvalidArtistException | Exceptions\InvalidFileUploadException | Exceptions\ArtworkNotFoundException $ex){
|
catch(Exceptions\InvalidArtworkException | Exceptions\InvalidArtworkTagException | Exceptions\InvalidArtistException | Exceptions\InvalidFileUploadException $ex){
|
||||||
|
|
||||||
// If we were passed a more generic file upload exception from `HttpInput`, swap it for a more specific exception to show to the user.
|
// If we were passed a more generic file upload exception from `HttpInput`, swap it for a more specific exception to show to the user.
|
||||||
if($ex instanceof Exceptions\InvalidFileUploadException){
|
if($ex instanceof Exceptions\InvalidFileUploadException){
|
||||||
$ex = new InvalidImageUploadException();
|
$ex = new Exceptions\InvalidImageUploadException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['artwork'] = $artwork;
|
$_SESSION['artwork'] = $artwork;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue