X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FX.pm;h=9343deab012d33a5b3cdbd94de1d4056697adedd;hb=cf96c5880f1ba0694298d7541fedce47c8c99051;hp=8c130c3c9f1c6c26fea323eb207f7faae42748b3;hpb=07d690e4c520994e05ba6aa89ee1b5b1c82bbcd4;p=kivitendo-erp.git diff --git a/SL/X.pm b/SL/X.pm index 8c130c3c9..9343deab0 100644 --- a/SL/X.pm +++ b/SL/X.pm @@ -1,10 +1,35 @@ package SL::X; use strict; +use warnings; -use Exception::Lite qw(declareExceptionClass); +use SL::X::Base; -declareExceptionClass('SL::X::FormError'); -declareExceptionClass('SL::X::DBHookError'); +use Exception::Class ( + 'SL::X::FormError' => { + isa => 'SL::X::Base', + }, + 'SL::X::DBError' => { + isa => 'SL::X::Base', + fields => [ qw(msg db_error) ], + defaults => { error_template => [ '%s: %s', qw(msg db_error) ] }, + }, + 'SL::X::DBHookError' => { + isa => 'SL::X::DBError', + fields => [ qw(when hook object object_type) ], + defaults => { error_template => [ '%s hook \'%s\' for object type \'%s\' failed', qw(when hook object_type object) ] }, + }, + 'SL::X::DBRoseError' => { + isa => 'SL::X::DBError', + fields => [ qw(class metaobject object) ], + defaults => { error_template => [ '\'%s\' in object of type \'%s\' occurred', qw(db_error class) ] }, + }, + 'SL::X::DBUtilsError' => { + isa => 'SL::X::DBError', + }, + 'SL::X::ZUGFeRDValidation' => { + isa => 'SL::X::Base', + }, +); 1;