X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=Koha%2FExceptions.pm;h=80156abee7c82e4d32324f32841badd184b8885a;hb=998289850f373a6b83d1ee4387161575fd6d3def;hp=dd8647b567d8099c0348123e9609d2245f55ca83;hpb=65558f20801dc7245de385af29fc7c650a8211f3;p=koha-ffzg.git diff --git a/Koha/Exceptions.pm b/Koha/Exceptions.pm index dd8647b567..80156abee7 100644 --- a/Koha/Exceptions.pm +++ b/Koha/Exceptions.pm @@ -2,46 +2,73 @@ package Koha::Exceptions; use Modern::Perl; +use Koha::Exception; + use Exception::Class ( - # General exceptions - 'Koha::Exceptions::Exception' => { - description => 'Something went wrong!', + 'Koha::Exceptions::BadParameter' => { + isa => 'Koha::Exception', + description => 'A bad parameter was given', + fields => ['parameter'], }, - 'Koha::Exceptions::DuplicateObject' => { - isa => 'Koha::Exceptions::Exception', + isa => 'Koha::Exception', description => 'Same object already exists', }, + 'Koha::Exceptions::InvalidStatus' => { + isa => 'Koha::Exception', + description => 'The current status is not valid in context', + fields => ['invalid_status'], + }, + 'Koha::Exceptions::ObjectNotFound' => { + isa => 'Koha::Exception', + description => 'The required object doesn\'t exist', + }, + 'Koha::Exceptions::PayloadTooLarge' => { + isa => 'Koha::Exception', + description => 'Request entity is larger than limits defined by server', + }, + 'Koha::Exceptions::ObjectNotCreated' => { + isa => 'Koha::Exception', + description => 'The object have not been created', + }, 'Koha::Exceptions::CannotDeleteDefault' => { - isa => 'Koha::Exceptions::Exception', + isa => 'Koha::Exception', description => 'The default value cannot be deleted' }, + 'Koha::Exceptions::CannotDeleteSystem' => { + isa => 'Koha::Exception', + description => 'The system value cannot be deleted' + }, 'Koha::Exceptions::MissingParameter' => { - isa => 'Koha::Exceptions::Exception', - description => 'A required parameter is missing' - }, - # Virtualshelves exceptions - 'Koha::Exceptions::Virtualshelves::DuplicateObject' => { - isa => 'Koha::Exceptions::DuplicateObject', - description => "Duplicate shelf object", - }, - 'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => { - isa => 'Koha::Exceptions::Exception', - description => 'Invalid key on accepting the share', - }, - 'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => { - isa => 'Koha::Exceptions::Exception', - description=> 'Invalid key on sharing a shelf', - }, - 'Koha::Exceptions::Virtualshelves::ShareHasExpired' => { - isa => 'Koha::Exceptions::Exception', - description=> 'Cannot share this shelf, the share has expired', - }, - 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => { - isa => 'Koha::Exceptions::Exception', - description => "Invalid use of database administrator account", - } + isa => 'Koha::Exception', + description => 'A required parameter is missing', + fields => ['parameter'], + }, + 'Koha::Exceptions::ParameterTooHigh' => { + isa => 'Koha::Exception', + description => 'A passed parameter value is too high' + }, + 'Koha::Exceptions::NoChanges' => { + isa => 'Koha::Exception', + description => 'No changes were made', + }, + 'Koha::Exceptions::WrongParameter' => { + isa => 'Koha::Exception', + description => 'One or more parameters are wrong', + }, + 'Koha::Exceptions::NoPermission' => { + isa => 'Koha::Exception', + description => 'You do not have permission for this action', + }, + 'Koha::Exceptions::CannotAddLibraryLimit' => { + isa => 'Koha::Exception', + description => 'General problem adding a library limit' + }, + 'Koha::Exceptions::UnderMaintenance' => { + isa => 'Koha::Exception', + description => 'Koha is under maintenance.' + }, ); 1;