@@ -1210,18 +1210,20 @@ sub compile_hooks {
1210
1210
eval { $EVAL_SHIM -> ($hook ,@_ ); 1; }
1211
1211
or do {
1212
1212
my $err = $@ || " Zombie Error" ;
1213
+ my $is_hook_exception = $position eq ' core.app.hook_exception' ;
1213
1214
# Don't execute the hook_exception hook if the exception
1214
1215
# has been generated from a hook exception handler itself,
1215
1216
# thus preventing potentially recursive code.
1216
1217
$app -> execute_hook( ' core.app.hook_exception' , $app , $err )
1217
- unless $position eq ' core.app.hook_exception ' ;
1218
+ unless $is_hook_exception ;
1218
1219
my $is_halted = $app -> response-> is_halted; # Capture before cleanup
1219
1220
# We can't cleanup if we're in the hook for a hook
1220
1221
# exception, as this would clear the custom response that
1221
1222
# may have been set by the hook. However, there is no need
1222
1223
# to do so, as the upper hook that called this hook
1223
1224
# exception will perform the cleanup instead anyway
1224
- $app -> cleanup unless $position eq ' core.app.hook_exception' ;
1225
+ $app -> cleanup
1226
+ unless $is_hook_exception ;
1225
1227
# Allow the hook function to halt the response, thus
1226
1228
# retaining any response it may have set. Otherwise the
1227
1229
# croak from this function will overwrite any content that
0 commit comments