From 7ac313cbcd1f7232af1e2a52e9ca8482d6f714ad Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 29 Dec 2016 14:42:58 +1300 Subject: [PATCH] Revert "Bug 17494: (QA followup) Fix exception name" This reverts commit 9a301836714924581b806cd7c728695625ddf3cc. --- Koha/AudioAlert.pm | 4 +--- Koha/Exceptions/Patron/Modification.pm | 10 +++------- t/db_dependent/Koha_borrower_modifications.t | 5 ++--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Koha/AudioAlert.pm b/Koha/AudioAlert.pm index d7f7c206fe..d86d9a17f0 100644 --- a/Koha/AudioAlert.pm +++ b/Koha/AudioAlert.pm @@ -43,9 +43,7 @@ sub store { if ( $self->verification_token ) { if ( Koha::Patron::Modifications->search( { verification_token => $self->verification_token } )->count() ) { - Koha::Exceptions::Patron::Modification::DuplicateVerificationToken->throw( - "Duplicate verification token " . $self->verification_token - ); + Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken->throw; } } diff --git a/Koha/Exceptions/Patron/Modification.pm b/Koha/Exceptions/Patron/Modification.pm index 4cf5cfafb1..1068fbb549 100644 --- a/Koha/Exceptions/Patron/Modification.pm +++ b/Koha/Exceptions/Patron/Modification.pm @@ -3,14 +3,10 @@ package Koha::Exceptions::Patron::Modification; use Modern::Perl; use Exception::Class ( - - 'Koha::Exceptions::Patron::Modification' => { - description => 'Something went wrong' + 'Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken' => { + isa => 'Koha::Exceptions::Object', + description => "The verification token given already exists", }, - 'Koha::Exceptions::Patron::Modification::DuplicateVerificationToken' => { - isa => 'Koha::Exceptions::Patron::Modification', - description => "The verification token given already exists" - } ); 1; diff --git a/t/db_dependent/Koha_borrower_modifications.t b/t/db_dependent/Koha_borrower_modifications.t index 78c0ce18dd..4d5daf8502 100755 --- a/t/db_dependent/Koha_borrower_modifications.t +++ b/t/db_dependent/Koha_borrower_modifications.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use Test::More tests => 16; +use Test::More tests => 15; use Try::Tiny; use t::lib::TestBuilder; @@ -31,9 +31,8 @@ try { } )->store(); } catch { - ok( $_->isa('Koha::Exceptions::Patron::Modification::DuplicateVerificationToken'), + ok( $_->isa('Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken'), 'Attempting to add a duplicate verification token to the database should raise a Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken exception' ); - is( $_->message, "Duplicate verification token 1234567890", 'Exception carries the right message' ); }; ## Get the new pending modification -- 2.20.1