X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FObject%2FHooks.pm;h=6a54869364cbe6715f06ef002b6b69f462227e94;hb=577042c61c5e1fffb8747079b4f9826e51532ee8;hp=ac3b0a2e60cf5779041c30d513db04a7b3951799;hpb=72b340de2352eec7d3f99a00e2141a2df35f07f3;p=kivitendo-erp.git diff --git a/SL/DB/Object/Hooks.pm b/SL/DB/Object/Hooks.pm index ac3b0a2e6..6a5486936 100644 --- a/SL/DB/Object/Hooks.pm +++ b/SL/DB/Object/Hooks.pm @@ -44,9 +44,10 @@ sub run_hooks { 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' ? '' : $sub), - object => $object) + SL::X::DBHookError->throw(when => $when, + hook => (ref($sub) eq 'CODE' ? '' : $sub), + object => $object, + object_type => ref($object)) if !$result; } } @@ -121,8 +122,8 @@ C function names above. An exception of C is thrown if any of the hooks returns a falsish value. -This function is supposed to be called by L, -L or L. +This function is supposed to be called by L, +L or L. =back