Bugzilla – Attachment 129329 Details for
Bug 29857
We must stringify our exceptions correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29857: Make the exception classes inherit from the base class
Bug-29857-Make-the-exception-classes-inherit-from-.patch (text/plain), 14.94 KB, created by
Jonathan Druart
on 2022-01-12 09:34:31 UTC
(
hide
)
Description:
Bug 29857: Make the exception classes inherit from the base class
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-01-12 09:34:31 UTC
Size:
14.94 KB
patch
obsolete
>From eb61c20d680c75adbb02fce2b8ea6e1fffc64dc9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Jan 2022 10:31:24 +0100 >Subject: [PATCH] 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 >--- > Koha/Exceptions/Account.pm | 4 +++- > Koha/Exceptions/Acquisition/Basket.pm | 4 +++- > Koha/Exceptions/ArticleRequest.pm | 6 ++++-- > Koha/Exceptions/Authentication.pm | 4 +++- > Koha/Exceptions/Authorization.pm | 4 +++- > Koha/Exceptions/Checkout.pm | 4 +++- > Koha/Exceptions/Checkouts/ReturnClaims.pm | 1 - > Koha/Exceptions/ClubHold.pm | 4 +++- > Koha/Exceptions/Config.pm | 4 +++- > Koha/Exceptions/Elasticsearch.pm | 4 +++- > Koha/Exceptions/Ill.pm | 4 +++- > Koha/Exceptions/Item/Transfer.pm | 4 +++- > Koha/Exceptions/Library.pm | 4 +++- > Koha/Exceptions/MarcOverlayRule.pm | 4 +++- > Koha/Exceptions/Metadata.pm | 4 +++- > Koha/Exceptions/Password.pm | 4 +++- > Koha/Exceptions/Patron.pm | 4 +++- > Koha/Exceptions/Patron/Attribute.pm | 4 +++- > Koha/Exceptions/Patron/Attribute/Type.pm | 4 +++- > Koha/Exceptions/Patron/Modification.pm | 4 +++- > Koha/Exceptions/Patron/Relationship.pm | 4 +++- > Koha/Exceptions/Token.pm | 4 +++- > Koha/Exceptions/TransferLimit.pm | 4 +++- > 23 files changed, 67 insertions(+), 24 deletions(-) > >diff --git a/Koha/Exceptions/Account.pm b/Koha/Exceptions/Account.pm >index c598dd92da1..a34c00ee3cc 100644 >--- a/Koha/Exceptions/Account.pm >+++ b/Koha/Exceptions/Account.pm >@@ -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', >diff --git a/Koha/Exceptions/Acquisition/Basket.pm b/Koha/Exceptions/Acquisition/Basket.pm >index 94ca5cbf51d..52fb45ab30b 100644 >--- a/Koha/Exceptions/Acquisition/Basket.pm >+++ b/Koha/Exceptions/Acquisition/Basket.pm >@@ -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', >diff --git a/Koha/Exceptions/ArticleRequest.pm b/Koha/Exceptions/ArticleRequest.pm >index ef0f25769ec..99e4059929e 100644 >--- a/Koha/Exceptions/ArticleRequest.pm >+++ b/Koha/Exceptions/ArticleRequest.pm >@@ -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; >\ No newline at end of file >+1; >diff --git a/Koha/Exceptions/Authentication.pm b/Koha/Exceptions/Authentication.pm >index 74688ab6fb3..e8c3227523a 100644 >--- a/Koha/Exceptions/Authentication.pm >+++ b/Koha/Exceptions/Authentication.pm >@@ -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', >diff --git a/Koha/Exceptions/Authorization.pm b/Koha/Exceptions/Authorization.pm >index a3c625aca83..1b070df1d05 100644 >--- a/Koha/Exceptions/Authorization.pm >+++ b/Koha/Exceptions/Authorization.pm >@@ -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', >diff --git a/Koha/Exceptions/Checkout.pm b/Koha/Exceptions/Checkout.pm >index ed4b0a5a273..f6ceb038fce 100644 >--- a/Koha/Exceptions/Checkout.pm >+++ b/Koha/Exceptions/Checkout.pm >@@ -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', >diff --git a/Koha/Exceptions/Checkouts/ReturnClaims.pm b/Koha/Exceptions/Checkouts/ReturnClaims.pm >index 8629bbb677a..d1a63f80378 100644 >--- a/Koha/Exceptions/Checkouts/ReturnClaims.pm >+++ b/Koha/Exceptions/Checkouts/ReturnClaims.pm >@@ -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', >diff --git a/Koha/Exceptions/ClubHold.pm b/Koha/Exceptions/ClubHold.pm >index e787c279084..d7ca3bf914d 100644 >--- a/Koha/Exceptions/ClubHold.pm >+++ b/Koha/Exceptions/ClubHold.pm >@@ -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', >diff --git a/Koha/Exceptions/Config.pm b/Koha/Exceptions/Config.pm >index 14ae3152461..2a9488eb628 100644 >--- a/Koha/Exceptions/Config.pm >+++ b/Koha/Exceptions/Config.pm >@@ -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', >diff --git a/Koha/Exceptions/Elasticsearch.pm b/Koha/Exceptions/Elasticsearch.pm >index 2068db9fdaf..37d993fcc6f 100644 >--- a/Koha/Exceptions/Elasticsearch.pm >+++ b/Koha/Exceptions/Elasticsearch.pm >@@ -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', >diff --git a/Koha/Exceptions/Ill.pm b/Koha/Exceptions/Ill.pm >index 0729fa47d2c..66d5adcdd97 100644 >--- a/Koha/Exceptions/Ill.pm >+++ b/Koha/Exceptions/Ill.pm >@@ -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', >diff --git a/Koha/Exceptions/Item/Transfer.pm b/Koha/Exceptions/Item/Transfer.pm >index a836714dbc6..0d8aea59c71 100644 >--- a/Koha/Exceptions/Item/Transfer.pm >+++ b/Koha/Exceptions/Item/Transfer.pm >@@ -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', >diff --git a/Koha/Exceptions/Library.pm b/Koha/Exceptions/Library.pm >index d4b0cfebc3c..06ee38cf0d5 100644 >--- a/Koha/Exceptions/Library.pm >+++ b/Koha/Exceptions/Library.pm >@@ -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' => { >diff --git a/Koha/Exceptions/MarcOverlayRule.pm b/Koha/Exceptions/MarcOverlayRule.pm >index f3596022e73..799469041fe 100644 >--- a/Koha/Exceptions/MarcOverlayRule.pm >+++ b/Koha/Exceptions/MarcOverlayRule.pm >@@ -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', >diff --git a/Koha/Exceptions/Metadata.pm b/Koha/Exceptions/Metadata.pm >index 8c95fa0556c..683bf9d50d2 100644 >--- a/Koha/Exceptions/Metadata.pm >+++ b/Koha/Exceptions/Metadata.pm >@@ -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', >diff --git a/Koha/Exceptions/Password.pm b/Koha/Exceptions/Password.pm >index 549e3b95193..7219a0092a2 100644 >--- a/Koha/Exceptions/Password.pm >+++ b/Koha/Exceptions/Password.pm >@@ -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', >diff --git a/Koha/Exceptions/Patron.pm b/Koha/Exceptions/Patron.pm >index 1bd51eb55ec..3c7ee9651f7 100644 >--- a/Koha/Exceptions/Patron.pm >+++ b/Koha/Exceptions/Patron.pm >@@ -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', >diff --git a/Koha/Exceptions/Patron/Attribute.pm b/Koha/Exceptions/Patron/Attribute.pm >index 97785d6e2a7..32f730f75e8 100644 >--- a/Koha/Exceptions/Patron/Attribute.pm >+++ b/Koha/Exceptions/Patron/Attribute.pm >@@ -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', >diff --git a/Koha/Exceptions/Patron/Attribute/Type.pm b/Koha/Exceptions/Patron/Attribute/Type.pm >index 741b2f7254b..11a3b577d12 100644 >--- a/Koha/Exceptions/Patron/Attribute/Type.pm >+++ b/Koha/Exceptions/Patron/Attribute/Type.pm >@@ -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', >diff --git a/Koha/Exceptions/Patron/Modification.pm b/Koha/Exceptions/Patron/Modification.pm >index d9ba650e641..790c930d2da 100644 >--- a/Koha/Exceptions/Patron/Modification.pm >+++ b/Koha/Exceptions/Patron/Modification.pm >@@ -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', >diff --git a/Koha/Exceptions/Patron/Relationship.pm b/Koha/Exceptions/Patron/Relationship.pm >index ca719cbe42c..318e13d5462 100644 >--- a/Koha/Exceptions/Patron/Relationship.pm >+++ b/Koha/Exceptions/Patron/Relationship.pm >@@ -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', >diff --git a/Koha/Exceptions/Token.pm b/Koha/Exceptions/Token.pm >index ae9bbec3c99..5f024feb07c 100644 >--- a/Koha/Exceptions/Token.pm >+++ b/Koha/Exceptions/Token.pm >@@ -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', >diff --git a/Koha/Exceptions/TransferLimit.pm b/Koha/Exceptions/TransferLimit.pm >index 1549ed23406..0225b2dbf8e 100644 >--- a/Koha/Exceptions/TransferLimit.pm >+++ b/Koha/Exceptions/TransferLimit.pm >@@ -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' => { >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29857
:
129329
|
129330
|
130007
|
130008
|
130009
|
130010
|
130011
|
130012
|
130013
|
130014
|
130015
|
130156
|
130157
|
130158
|
130355
|
131112
|
131113
|
131114
|
131115
|
131116
|
131117
|
131232
|
131240
|
131241
|
131242
|
131243
|
131244
|
131256
|
131258
|
131287
|
131288
|
131289
|
131290
|
131291