mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 06:10:36 -04:00
Rename SeException class to AppException
This commit is contained in:
parent
3a02ab281d
commit
12cf83a843
39 changed files with 45 additions and 45 deletions
5
lib/Exceptions/AppException.php
Normal file
5
lib/Exceptions/AppException.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class AppException extends \Exception{
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class EbookParsingException extends SeException{
|
||||
class EbookParsingException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidAuthorException extends SeException{
|
||||
class InvalidAuthorException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidCaptchaException extends SeException{
|
||||
class InvalidCaptchaException extends AppException{
|
||||
protected $message = 'We couldn’t validate your CAPTCHA response.';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidCollectionException extends SeException{
|
||||
class InvalidCollectionException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidCredentialsException extends SeException{
|
||||
class InvalidCredentialsException extends AppException{
|
||||
protected $message = 'Invalid credentials.';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEbookException extends SeException{
|
||||
class InvalidEbookException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidEmailException extends SeException{
|
||||
class InvalidEmailException extends AppException{
|
||||
protected $message = 'We couldn’t understand your email address.';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidFileException extends SeException{
|
||||
class InvalidFileException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidNewsletterSubscriptionException extends SeException{
|
||||
class InvalidNewsletterSubscriptionException extends AppException{
|
||||
protected $message = 'We couldn’t find you in our newsletter subscribers list.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPatronException extends SeException{
|
||||
class InvalidPatronException extends AppException{
|
||||
protected $message = 'We couldn’t locate you in the Patrons Circle.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPermissionsException extends SeException{
|
||||
class InvalidPermissionsException extends AppException{
|
||||
protected $message = 'You don’t have permission to perform that action.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPollException extends SeException{
|
||||
class InvalidPollException extends AppException{
|
||||
protected $message = 'We couldn’t locate that poll.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPollItemException extends SeException{
|
||||
class InvalidPollItemException extends AppException{
|
||||
protected $message = 'We couldn’t locate that poll item.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPollVoteException extends SeException{
|
||||
class InvalidPollVoteException extends AppException{
|
||||
protected $message = 'We couldn’t locate that vote.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidRequestException extends SeException{
|
||||
class InvalidRequestException extends AppException{
|
||||
protected $message = 'Invalid request.';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidSessionException extends SeException{
|
||||
class InvalidSessionException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidUserException extends SeException{
|
||||
class InvalidUserException extends AppException{
|
||||
protected $message = 'We couldn’t locate you in our system.';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class LoginRequiredException extends SeException{
|
||||
class LoginRequiredException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class NewsletterRequiredException extends SeException{
|
||||
class NewsletterRequiredException extends AppException{
|
||||
protected $message = 'You must select at least one newsletter to subscribe to.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class NewsletterSubscriptionExistsException extends SeException{
|
||||
class NewsletterSubscriptionExistsException extends AppException{
|
||||
protected $message = 'You’re already subscribed to the newsletter.';
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class NoopException extends SeException{
|
||||
class NoopException extends AppException{
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class PaymentExistsException extends SeException{
|
||||
class PaymentExistsException extends AppException{
|
||||
protected $message = 'This transaction ID already exists.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class PollClosedException extends SeException{
|
||||
class PollClosedException extends AppException{
|
||||
protected $message = 'This poll is not open to voting right now.';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class PollItemRequiredException extends SeException{
|
||||
class PollItemRequiredException extends AppException{
|
||||
protected $message = 'You must select an item to vote on.';
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class PollVoteExistsException extends SeException{
|
||||
class PollVoteExistsException extends AppException{
|
||||
public $Vote = null;
|
||||
protected $message = 'You’ve already voted in this poll.';
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class SeException extends \Exception{
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class SeeOtherEbookException extends SeException{
|
||||
class SeeOtherEbookException extends AppException{
|
||||
public $Url;
|
||||
|
||||
public function __construct(string $url = ''){
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class UserExistsException extends SeException{
|
||||
class UserExistsException extends AppException{
|
||||
protected $message = 'This email already exists in the database.';
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class ValidationException extends SeException{
|
||||
class ValidationException extends AppException{
|
||||
public $Exceptions = [];
|
||||
public $HasExceptions = false;
|
||||
public $IsFatal = false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class WebhookException extends SeException{
|
||||
class WebhookException extends AppException{
|
||||
public $PostData;
|
||||
|
||||
public function __construct(string $message = '', string $data = null){
|
||||
|
|
|
@ -331,7 +331,7 @@ class Library{
|
|||
public static function RebuildBulkDownloadsCache(): array{
|
||||
$collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names
|
||||
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 = [];
|
||||
$subjects = [];
|
||||
|
@ -396,7 +396,7 @@ class Library{
|
|||
$retval = null;
|
||||
$collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names
|
||||
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){
|
||||
|
@ -449,7 +449,7 @@ class Library{
|
|||
|
||||
$collator = Collator::create('en_US'); // Used for sorting letters with diacritics like in author names
|
||||
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 = [];
|
||||
|
|
|
@ -39,7 +39,7 @@ try{
|
|||
http_response_code(201);
|
||||
}
|
||||
}
|
||||
catch(Exceptions\SeException){
|
||||
catch(Exceptions\AppException){
|
||||
Template::Emit404();
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ catch(Exceptions\NewsletterSubscriptionExistsException){
|
|||
http_response_code(409);
|
||||
}
|
||||
}
|
||||
catch(Exceptions\SeException $ex){
|
||||
catch(Exceptions\AppException $ex){
|
||||
// Validation failed
|
||||
if($requestType == WEB){
|
||||
$_SESSION['subscription'] = $subscription;
|
||||
|
|
|
@ -20,13 +20,13 @@ try{
|
|||
try{
|
||||
PollVote::Get($poll->UrlName, $GLOBALS['User']->UserId);
|
||||
}
|
||||
catch(Exceptions\SeException){
|
||||
catch(Exceptions\AppException){
|
||||
// User has already voted
|
||||
$canVote = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exceptions\SeException){
|
||||
catch(Exceptions\AppException){
|
||||
Template::Emit404();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ try{
|
|||
session_unset();
|
||||
}
|
||||
}
|
||||
catch(Exceptions\SeException){
|
||||
catch(Exceptions\AppException){
|
||||
Template::Emit404();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ $poll = new Poll();
|
|||
try{
|
||||
$poll = Poll::GetByUrlName(HttpInput::Str(GET, 'pollurlname', false));
|
||||
}
|
||||
catch(Exceptions\SeException){
|
||||
catch(Exceptions\AppException){
|
||||
Template::Emit404();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ try{
|
|||
header('Location: ' . $vote->Url);
|
||||
}
|
||||
}
|
||||
catch(Exceptions\SeException $ex){
|
||||
catch(Exceptions\AppException $ex){
|
||||
// Validation failed
|
||||
if($requestType == WEB){
|
||||
$_SESSION['vote'] = $vote;
|
||||
|
|
|
@ -34,7 +34,7 @@ try{
|
|||
header('Location: ' . $session->Url);
|
||||
}
|
||||
}
|
||||
catch(Exceptions\SeException $ex){
|
||||
catch(Exceptions\AppException $ex){
|
||||
// Login failed
|
||||
if($requestType == WEB){
|
||||
$_SESSION['email'] = $email;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue