Bug 29857: Make the exception classes inherit from the base class

We have a base class Koha::Exceptions::Exception but it's not used in
most of our exception classes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2022-01-12 10:31:24 +01:00 committed by Fridolin Somers
parent 5daa64ca10
commit 42096deea4
23 changed files with 67 additions and 24 deletions

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Account;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Account' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Account::IsNotCredit' => {
isa => 'Koha::Exceptions::Account',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Acquisition::Basket;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Acquisition::Basket' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Acquisition::Basket::AlreadyClosed' => {
isa => 'Koha::Exceptions::Acquisition::Basket',

View file

@ -17,9 +17,11 @@ package Koha::Exceptions::ArticleRequest;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::ArticleRequest' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::ArticleRequest::LimitReached' => {
isa => 'Koha::Exceptions::ArticleRequest',
@ -43,4 +45,4 @@ Exception to be used when the article request limit has been reached.
=cut
1;
1;

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Authentication;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Authentication' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Authentication::Required' => {
isa => 'Koha::Exceptions::Authentication',

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Authorization;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Authorization' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Authorization::Unauthorized' => {
isa => 'Koha::Exceptions::Authorization',

View file

@ -2,9 +2,11 @@ package Koha::Exceptions::Checkout;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Checkout' => {
description => "Something went wrong!"
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Checkout::FailedRenewal' => {
isa => 'Koha::Exceptions::Checkout',

View file

@ -22,7 +22,6 @@ use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Checkouts::ReturnClaims' => {
isa => 'Koha::Exceptions::Exception',
description => 'Something went wrong!',
},
'Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy' => {
isa => 'Koha::Exceptions::Checkouts::ReturnClaims',

View file

@ -2,9 +2,11 @@ package Koha::Exceptions::ClubHold;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::ClubHold' => {
description => "Something went wrong!",
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::ClubHold::NoPatrons' => {
isa => 'Koha::Exceptions::ClubHold',

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Config;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Config' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Config::MissingEntry' => {
isa => 'Koha::Exceptions::Config',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Elasticsearch;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Elasticsearch' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Elasticsearch::BadResponse' => {
isa => 'Koha::Exceptions::Elasticsearch',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Ill;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Ill' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Ill::InvalidBackendId' => {
isa => 'Koha::Exceptions::Ill',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Item::Transfer;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Item::Transfer' => {
description => 'Something went wrong'
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Item::Transfer::InQueue' => {
isa => 'Koha::Exceptions::Item::Transfer',

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Library;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Library::Exception' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Library::NotFound' => {

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::MarcOverlayRule;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::MarcOverlayRule' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::MarcOverlayRule::InvalidTagRegExp' => {
isa => 'Koha::Exceptions::MarcOverlayRule',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Metadata;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Metadata' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Metadata::Invalid' => {
isa => 'Koha::Exceptions::Metadata',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Password;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Password' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Password::Invalid' => {
isa => 'Koha::Exceptions::Password',

View file

@ -2,9 +2,11 @@ package Koha::Exceptions::Patron;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Patron' => {
description => "Something went wrong!"
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Patron::FailedDelete' => {
isa => 'Koha::Exceptions::Patron',

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Patron::Attribute;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Patron::Attribute' => {
description => 'Something went wrong'
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Patron::Attribute::InvalidType' => {
isa => 'Koha::Exceptions::Patron::Attribute',

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Patron::Attribute::Type;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Patron::Attribute::Type' => {
description => 'Something went wrong'
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Patron::Attribute::Type::CannotChangeProperty' => {
isa => 'Koha::Exceptions::Patron::Attribute::Type',

View file

@ -2,10 +2,12 @@ package Koha::Exceptions::Patron::Modification;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Patron::Modification' => {
description => 'Something went wrong'
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Patron::Modification::DuplicateVerificationToken' => {
isa => 'Koha::Exceptions::Patron::Modification',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::Patron::Relationship;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Patron::Relationship' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Patron::Relationship::DuplicateRelationship' => {
isa => 'Koha::Exceptions::Patron::Relationship',

View file

@ -17,9 +17,11 @@ package Koha::Exceptions::Token;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::Token' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::Token::BadPattern' => {
isa => 'Koha::Exceptions::Token',

View file

@ -17,10 +17,12 @@ package Koha::Exceptions::TransferLimit;
use Modern::Perl;
use Koha::Exceptions::Exception;
use Exception::Class (
'Koha::Exceptions::TransferLimit::Exception' => {
description => 'Something went wrong!',
isa => 'Koha::Exceptions::Exception',
},
'Koha::Exceptions::TransferLimit::Duplicate' => {