X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FX.pm;h=b8ae60ac632d36d45975c46c691ae026cb8a6c6a;hb=30d53fc86a48efdd6f613c571afad322d5f11b39;hp=4ecfc7dfaaf2ba6a38d340e4bd67613d33494a27;hpb=e02423365c5452cde1d5148a6dfb2d22d7cf5390;p=kivitendo-erp.git diff --git a/SL/X.pm b/SL/X.pm index 4ecfc7dfa..b8ae60ac6 100644 --- a/SL/X.pm +++ b/SL/X.pm @@ -1,13 +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::DBError', [ '%s %s', qw(error msg) ]); -declareExceptionClass('SL::X::DBHookError', 'SL::X::DBError', [ '%s hook \'%s\' for object type \'%s\' failed', qw(when hook object_type object) ]); -declareExceptionClass('SL::X::DBRoseError', 'SL::X::DBError', [ '\'%s\' in object of type \'%s\' occured', qw(error class) ]); -declareExceptionClass('SL::X::DBUtilsError', 'SL::X::DBError', [ '%s: %s', qw(msg error) ]); +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\' occured', qw(db_error class) ] }, + }, + 'SL::X::DBUtilsError' => { + isa => 'SL::X::DBError', + }, + 'SL::X::ZUGFeRDValidation' => { + isa => 'SL::X::Base', + }, +); 1;