From 3c2819081dd29e7def508b34ef4b79798f6f7a6c Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 8 Jan 2022 19:59:33 -0600 Subject: [PATCH] Better exception matching --- www/ebooks/author.php | 2 +- www/ebooks/ebook.php | 2 +- www/ebooks/index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/ebooks/author.php b/www/ebooks/author.php index 43b3ed79..c22c5a2b 100644 --- a/www/ebooks/author.php +++ b/www/ebooks/author.php @@ -16,7 +16,7 @@ try{ throw new InvalidAuthorException(); } } -catch(\Exception $ex){ +catch(InvalidAuthorException $ex){ http_response_code(404); include(WEB_ROOT . '/404.php'); exit(); diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 7b726d61..d7221508 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -65,7 +65,7 @@ catch(SeeOtherEbookException $ex){ header('Location: ' . $ex->Url); exit(); } -catch(\Exception $ex){ +catch(InvalidEbookException $ex){ http_response_code(404); include(WEB_ROOT . '/404.php'); exit(); diff --git a/www/ebooks/index.php b/www/ebooks/index.php index a6c2f499..ea6b933e 100644 --- a/www/ebooks/index.php +++ b/www/ebooks/index.php @@ -127,7 +127,7 @@ try{ $queryString = preg_replace('/^&/ius', '', $queryString); } -catch(\Exception $ex){ +catch(InvalidCollectionException $ex){ http_response_code(404); include(WEB_ROOT . '/404.php'); exit();