Revision 6bdcd838
Von Moritz Bunkus vor etwa 5 Jahren hinzugefügt
SL/X.pm | ||
---|---|---|
1 | 1 |
package SL::X; |
2 | 2 |
|
3 | 3 |
use strict; |
4 |
use warnings; |
|
4 | 5 |
|
5 |
use Exception::Lite qw(declareExceptionClass);
|
|
6 |
use SL::X::Base;
|
|
6 | 7 |
|
7 |
declareExceptionClass('SL::X::FormError'); |
|
8 |
declareExceptionClass('SL::X::DBError', [ '%s %s', qw(error msg) ]); |
|
9 |
declareExceptionClass('SL::X::DBHookError', 'SL::X::DBError', [ '%s hook \'%s\' for object type \'%s\' failed', qw(when hook object_type object) ]); |
|
10 |
declareExceptionClass('SL::X::DBRoseError', 'SL::X::DBError', [ '\'%s\' in object of type \'%s\' occured', qw(error class) ]); |
|
11 |
declareExceptionClass('SL::X::DBUtilsError', 'SL::X::DBError', [ '%s: %s', qw(msg error) ]); |
|
8 |
use Exception::Class ( |
|
9 |
'SL::X::FormError' => { |
|
10 |
isa => 'SL::X::Base', |
|
11 |
}, |
|
12 |
'SL::X::DBError' => { |
|
13 |
isa => 'SL::X::Base', |
|
14 |
fields => [ qw(msg db_error) ], |
|
15 |
defaults => { error_template => [ '%s: %s', qw(msg db_error) ] }, |
|
16 |
}, |
|
17 |
'SL::X::DBHookError' => { |
|
18 |
isa => 'SL::X::DBError', |
|
19 |
fields => [ qw(when hook object object_type) ], |
|
20 |
defaults => { error_template => [ '%s hook \'%s\' for object type \'%s\' failed', qw(when hook object_type object) ] }, |
|
21 |
}, |
|
22 |
'SL::X::DBRoseError' => { |
|
23 |
isa => 'SL::X::DBError', |
|
24 |
fields => [ qw(class metaobject object) ], |
|
25 |
defaults => { error_template => [ '\'%s\' in object of type \'%s\' occured', qw(db_error class) ] }, |
|
26 |
}, |
|
27 |
'SL::X::DBUtilsError' => { |
|
28 |
isa => 'SL::X::DBError', |
|
29 |
}, |
|
30 |
); |
|
12 | 31 |
|
13 | 32 |
1; |
Auch abrufbar als: Unified diff
Module: Exception::Lite durch Exception::Class ersetzt