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)
+ die SL::X::DBHookError->new(when => $when,
+ hook => (ref($sub) eq 'CODE' ? '<anonymous sub>' : $sub),
+ object => $object,
+ object_type => ref($object))
if !$result;
}
}
use Exception::Lite qw(declareExceptionClass);
declareExceptionClass('SL::X::FormError');
-declareExceptionClass('SL::X::DBHookError', [ '%s hook \'%s\' failed', qw(when hook object) ]);
+declareExceptionClass('SL::X::DBHookError', [ '%s hook \'%s\' for object type \'%s\' failed', qw(when hook object_type object) ]);
1;