epic-s6ts
[kivitendo-erp.git] / SL / X.pm
1 package SL::X;
2
3 use strict;
4 use warnings;
5
6 use SL::X::Base;
7
8
9 # note! the default fields "message", "error" and "show_trace" are created by
10 # Exception::Class if message or error are given, they are used for
11 # stringification, so don't use them in error_templates
12 #
13 use Exception::Class (
14   'SL::X::FormError'    => {
15     isa                 => 'SL::X::Base',
16   },
17   'SL::X::DBError'      => {
18     isa                 => 'SL::X::Base',
19     fields              => [ qw(msg db_error) ],
20     defaults            => { error_template => [ '%s: %s', qw(msg db_error) ] },
21   },
22   'SL::X::DBHookError'  => {
23     isa                 => 'SL::X::DBError',
24     fields              => [ qw(when hook object object_type) ],
25     defaults            => { error_template => [ '%s hook \'%s\' for object type \'%s\' failed', qw(when hook object_type object) ] },
26   },
27   'SL::X::DBRoseError'  => {
28     isa                 => 'SL::X::DBError',
29     fields              => [ qw(class metaobject object) ],
30     defaults            => { error_template => [ '\'%s\' in object of type \'%s\' occurred', qw(db_error class) ] },
31   },
32   'SL::X::DBUtilsError' => {
33     isa                 => 'SL::X::DBError',
34   },
35   'SL::X::ZUGFeRDValidation' => {
36     isa                 => 'SL::X::Base',
37   },
38   'SL::X::Inventory' => {
39     isa                 => 'SL::X::Base',
40     fields              => [ qw(code) ],
41   },
42   'SL::X::Inventory::Allocation' => {
43     isa                 => 'SL::X::Base',
44     fields              => [ qw(code) ],
45   },
46 );
47
48 1;