From 02917b275881202aec6e9f3d1be5e25c7ec1c383 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 26 Oct 2016 14:32:44 +0300 Subject: [PATCH] [SIGNED-OFF] Bug 17499: Add useful Koha::Exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds some basic Koha::Exceptions that will be useful. Signed-off-by: Marc VĂ©ron Signed-off-by: Josef Moravec --- Koha/Exceptions.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Koha/Exceptions.pm b/Koha/Exceptions.pm index 60b9e6a..ff04b9e 100644 --- a/Koha/Exceptions.pm +++ b/Koha/Exceptions.pm @@ -8,6 +8,12 @@ use Exception::Class ( 'Koha::Exceptions::Exception' => { description => 'Something went wrong!', }, + + 'Koha::Exceptions::BadParameter' => { + isa => 'Koha::Exceptions::Exception', + description => 'Bad given parameter', + fields => ['parameter'], + }, 'Koha::Exceptions::DuplicateObject' => { isa => 'Koha::Exceptions::Exception', description => 'Same object already exists', @@ -22,7 +28,13 @@ use Exception::Class ( }, 'Koha::Exceptions::MissingParameter' => { isa => 'Koha::Exceptions::Exception', - description => 'A required parameter is missing' + description => 'A required parameter is missing', + fields => ['parameter'], + }, + 'Koha::Exceptions::TooManyParameters' => { + isa => 'Koha::Exceptions::Exception', + description => 'Too many parameters given', + fields => ['parameter'], }, 'Koha::Exceptions::WrongParameter' => { isa => 'Koha::Exceptions::Exception', -- 2.1.4