Rename SeException class to AppException

This commit is contained in:
Alex Cabal 2023-07-14 09:36:10 -05:00
parent 3a02ab281d
commit 12cf83a843
39 changed files with 45 additions and 45 deletions

View file

@ -0,0 +1,5 @@
<?
namespace Exceptions;
class AppException extends \Exception{
}

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class EbookParsingException extends SeException{ class EbookParsingException extends AppException{
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidAuthorException extends SeException{ class InvalidAuthorException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidCaptchaException extends SeException{ class InvalidCaptchaException extends AppException{
protected $message = 'We couldnt validate your CAPTCHA response.'; protected $message = 'We couldnt validate your CAPTCHA response.';
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidCollectionException extends SeException{ class InvalidCollectionException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidCredentialsException extends SeException{ class InvalidCredentialsException extends AppException{
protected $message = 'Invalid credentials.'; protected $message = 'Invalid credentials.';
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidEbookException extends SeException{ class InvalidEbookException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidEmailException extends SeException{ class InvalidEmailException extends AppException{
protected $message = 'We couldnt understand your email address.'; protected $message = 'We couldnt understand your email address.';
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidFileException extends SeException{ class InvalidFileException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidNewsletterSubscriptionException extends SeException{ class InvalidNewsletterSubscriptionException extends AppException{
protected $message = 'We couldnt find you in our newsletter subscribers list.'; protected $message = 'We couldnt find you in our newsletter subscribers list.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidPatronException extends SeException{ class InvalidPatronException extends AppException{
protected $message = 'We couldnt locate you in the Patrons Circle.'; protected $message = 'We couldnt locate you in the Patrons Circle.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidPermissionsException extends SeException{ class InvalidPermissionsException extends AppException{
protected $message = 'You dont have permission to perform that action.'; protected $message = 'You dont have permission to perform that action.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidPollException extends SeException{ class InvalidPollException extends AppException{
protected $message = 'We couldnt locate that poll.'; protected $message = 'We couldnt locate that poll.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidPollItemException extends SeException{ class InvalidPollItemException extends AppException{
protected $message = 'We couldnt locate that poll item.'; protected $message = 'We couldnt locate that poll item.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidPollVoteException extends SeException{ class InvalidPollVoteException extends AppException{
protected $message = 'We couldnt locate that vote.'; protected $message = 'We couldnt locate that vote.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidRequestException extends SeException{ class InvalidRequestException extends AppException{
protected $message = 'Invalid request.'; protected $message = 'Invalid request.';
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidSessionException extends SeException{ class InvalidSessionException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class InvalidUserException extends SeException{ class InvalidUserException extends AppException{
protected $message = 'We couldnt locate you in our system.'; protected $message = 'We couldnt locate you in our system.';
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class LoginRequiredException extends SeException{ class LoginRequiredException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class NewsletterRequiredException extends SeException{ class NewsletterRequiredException extends AppException{
protected $message = 'You must select at least one newsletter to subscribe to.'; protected $message = 'You must select at least one newsletter to subscribe to.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class NewsletterSubscriptionExistsException extends SeException{ class NewsletterSubscriptionExistsException extends AppException{
protected $message = 'Youre already subscribed to the newsletter.'; protected $message = 'Youre already subscribed to the newsletter.';
} }

View file

@ -1,5 +1,5 @@
<? <?
namespace Exceptions; namespace Exceptions;
class NoopException extends SeException{ class NoopException extends AppException{
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class PaymentExistsException extends SeException{ class PaymentExistsException extends AppException{
protected $message = 'This transaction ID already exists.'; protected $message = 'This transaction ID already exists.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class PollClosedException extends SeException{ class PollClosedException extends AppException{
protected $message = 'This poll is not open to voting right now.'; protected $message = 'This poll is not open to voting right now.';
} }

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class PollItemRequiredException extends SeException{ class PollItemRequiredException extends AppException{
protected $message = 'You must select an item to vote on.'; protected $message = 'You must select an item to vote on.';
} }

View file

@ -1,7 +1,7 @@
<? <?
namespace Exceptions; namespace Exceptions;
class PollVoteExistsException extends SeException{ class PollVoteExistsException extends AppException{
public $Vote = null; public $Vote = null;
protected $message = 'Youve already voted in this poll.'; protected $message = 'Youve already voted in this poll.';

View file

@ -1,5 +0,0 @@
<?
namespace Exceptions;
class SeException extends \Exception{
}

View file

@ -1,7 +1,7 @@
<? <?
namespace Exceptions; namespace Exceptions;
class SeeOtherEbookException extends SeException{ class SeeOtherEbookException extends AppException{
public $Url; public $Url;
public function __construct(string $url = ''){ public function __construct(string $url = ''){

View file

@ -1,6 +1,6 @@
<? <?
namespace Exceptions; namespace Exceptions;
class UserExistsException extends SeException{ class UserExistsException extends AppException{
protected $message = 'This email already exists in the database.'; protected $message = 'This email already exists in the database.';
} }

View file

@ -1,7 +1,7 @@
<? <?
namespace Exceptions; namespace Exceptions;
class ValidationException extends SeException{ class ValidationException extends AppException{
public $Exceptions = []; public $Exceptions = [];
public $HasExceptions = false; public $HasExceptions = false;
public $IsFatal = false; public $IsFatal = false;

View file

@ -1,7 +1,7 @@
<? <?
namespace Exceptions; namespace Exceptions;
class WebhookException extends SeException{ class WebhookException extends AppException{
public $PostData; public $PostData;
public function __construct(string $message = '', string $data = null){ public function __construct(string $message = '', string $data = null){

View file

@ -331,7 +331,7 @@ class Library{
public static function RebuildBulkDownloadsCache(): array{ public static function RebuildBulkDownloadsCache(): array{
$collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names $collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names
if($collator === null){ if($collator === null){
throw new Exceptions\SeException('Couldn\'t create collator object when rebuilding bulk download cache.'); throw new Exceptions\AppException('Couldn\'t create collator object when rebuilding bulk download cache.');
} }
$months = []; $months = [];
$subjects = []; $subjects = [];
@ -396,7 +396,7 @@ class Library{
$retval = null; $retval = null;
$collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names $collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names
if($collator === null){ if($collator === null){
throw new Exceptions\SeException('Couldn\'t create collator object when rebuilding feeds cache.'); throw new Exceptions\AppException('Couldn\'t create collator object when rebuilding feeds cache.');
} }
foreach($feedTypes as $type){ foreach($feedTypes as $type){
@ -449,7 +449,7 @@ class Library{
$collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names $collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names
if($collator === null){ if($collator === null){
throw new Exceptions\SeException('Couldn\'t create collator object when rebuilding cache.'); throw new Exceptions\AppException('Couldn\'t create collator object when rebuilding cache.');
} }
$ebooks = []; $ebooks = [];

View file

@ -39,7 +39,7 @@ try{
http_response_code(201); http_response_code(201);
} }
} }
catch(Exceptions\SeException){ catch(Exceptions\AppException){
Template::Emit404(); Template::Emit404();
} }

View file

@ -101,7 +101,7 @@ catch(Exceptions\NewsletterSubscriptionExistsException){
http_response_code(409); http_response_code(409);
} }
} }
catch(Exceptions\SeException $ex){ catch(Exceptions\AppException $ex){
// Validation failed // Validation failed
if($requestType == WEB){ if($requestType == WEB){
$_SESSION['subscription'] = $subscription; $_SESSION['subscription'] = $subscription;

View file

@ -20,13 +20,13 @@ try{
try{ try{
PollVote::Get($poll->UrlName, $GLOBALS['User']->UserId); PollVote::Get($poll->UrlName, $GLOBALS['User']->UserId);
} }
catch(Exceptions\SeException){ catch(Exceptions\AppException){
// User has already voted // User has already voted
$canVote = true; $canVote = true;
} }
} }
} }
catch(Exceptions\SeException){ catch(Exceptions\AppException){
Template::Emit404(); Template::Emit404();
} }

View file

@ -17,7 +17,7 @@ try{
session_unset(); session_unset();
} }
} }
catch(Exceptions\SeException){ catch(Exceptions\AppException){
Template::Emit404(); Template::Emit404();
} }

View file

@ -6,7 +6,7 @@ $poll = new Poll();
try{ try{
$poll = Poll::GetByUrlName(HttpInput::Str(GET, 'pollurlname', false)); $poll = Poll::GetByUrlName(HttpInput::Str(GET, 'pollurlname', false));
} }
catch(Exceptions\SeException){ catch(Exceptions\AppException){
Template::Emit404(); Template::Emit404();
} }

View file

@ -33,7 +33,7 @@ try{
header('Location: ' . $vote->Url); header('Location: ' . $vote->Url);
} }
} }
catch(Exceptions\SeException $ex){ catch(Exceptions\AppException $ex){
// Validation failed // Validation failed
if($requestType == WEB){ if($requestType == WEB){
$_SESSION['vote'] = $vote; $_SESSION['vote'] = $vote;

View file

@ -34,7 +34,7 @@ try{
header('Location: ' . $session->Url); header('Location: ' . $session->Url);
} }
} }
catch(Exceptions\SeException $ex){ catch(Exceptions\AppException $ex){
// Login failed // Login failed
if($requestType == WEB){ if($requestType == WEB){
$_SESSION['email'] = $email; $_SESSION['email'] = $email;