Revision 6bdcd838
Von Moritz Bunkus vor mehr als 6 Jahren hinzugefügt
SL/DB/Object/Hooks.pm | ||
---|---|---|
|
||
foreach my $sub (@{ ( $hooks{$when} || { })->{ ref($object) } || [ ] }) {
|
||
my $result = ref($sub) eq 'CODE' ? $sub->($object, @args) : $object->call_sub($sub, @args);
|
||
die SL::X::DBHookError->new(when => $when,
|
||
hook => (ref($sub) eq 'CODE' ? '<anonymous sub>' : $sub),
|
||
object => $object,
|
||
object_type => ref($object))
|
||
SL::X::DBHookError->throw(when => $when,
|
||
hook => (ref($sub) eq 'CODE' ? '<anonymous sub>' : $sub),
|
||
object => $object,
|
||
object_type => ref($object))
|
||
if !$result;
|
||
}
|
||
}
|
Auch abrufbar als: Unified diff
Module: Exception::Lite durch Exception::Class ersetzt