X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FObject%2FHooks.pm;h=371e4450e4198133ccdd7990664d37aa5c72b04a;hb=117332fcc34457aadb85db18dbc42f48d32b732e;hp=00567559a32b7bcecda48d8d67028e59e6f27ec2;hpb=fb99b68ae1fff41a0b05666ceb772a2b3d4acb64;p=kivitendo-erp.git diff --git a/SL/DB/Object/Hooks.pm b/SL/DB/Object/Hooks.pm index 00567559a..371e4450e 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; + die SL::X::DBHookError->new(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