X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FObject%2FHooks.pm;h=6a54869364cbe6715f06ef002b6b69f462227e94;hb=f01ed5d1c0d1bed1d04005e004a785c6cf047233;hp=f2dfde49b38515841d3378c983d75c4f078daa17;hpb=07d690e4c520994e05ba6aa89ee1b5b1c82bbcd4;p=kivitendo-erp.git diff --git a/SL/DB/Object/Hooks.pm b/SL/DB/Object/Hooks.pm index f2dfde49b..6a5486936 100644 --- a/SL/DB/Object/Hooks.pm +++ b/SL/DB/Object/Hooks.pm @@ -44,7 +44,11 @@ sub run_hooks { foreach my $sub (@{ ( $hooks{$when} || { })->{ ref($object) } || [ ] }) { my $result = ref($sub) eq 'CODE' ? $sub->($object, @args) : $object->call_sub($sub, @args); - SL::X::DBHookError->throw(error => "${when} hook '" . (ref($sub) eq 'CODE' ? '' : $sub) . "' failed") if !$result; + SL::X::DBHookError->throw(when => $when, + hook => (ref($sub) eq 'CODE' ? '' : $sub), + object => $object, + object_type => ref($object)) + if !$result; } } @@ -118,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