X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/SL/DB/Object/Hooks.pm diff --git a/SL/DB/Object/Hooks.pm b/SL/DB/Object/Hooks.pm index 371e4450e..6a5486936 100644 --- a/SL/DB/Object/Hooks.pm +++ b/SL/DB/Object/Hooks.pm @@ -44,10 +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, - object_type => ref($object)) + SL::X::DBHookError->throw(when => $when, + hook => (ref($sub) eq 'CODE' ? '' : $sub), + object => $object, + object_type => ref($object)) if !$result; } }