From eb1c69f36bcf520f652d62e37139caf8bc005c85 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 26 Oct 2016 14:32:44 +0300 Subject: [PATCH] Bug 17499: Add useful Koha::Exceptions This patch adds some basic Koha::Exceptions that will be useful. --- 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.7.4