summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-10-22 15:32:05 +0200
committerYorhel <git@yorhel.nl>2008-10-22 15:32:05 +0200
commit2cadd675813a9a3bd44eb7bc61a5ef4de724fb99 (patch)
tree608c8409f48faa167e3087b1336fade1cae5ef8c
parent697d42c6ffcde0997dd3d8f07abb230ab414fd76 (diff)
Automatically reset the response data before calling the error_500_handler
Because the state of the response object isn't really guaranteed to be stable after a function unexpectedly died...
-rw-r--r--lib/YAWF.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/YAWF.pm b/lib/YAWF.pm
index 47b7706..624cc35 100644
--- a/lib/YAWF.pm
+++ b/lib/YAWF.pm
@@ -170,7 +170,10 @@ sub handle_request {
# Call the error_500_handler
# The handler should manually call dbCommit if it makes any changes to the DB
- eval { $self->{_YAWF}{error_500_handler}->($self); };
+ eval {
+ $self->resInit;
+ $self->{_YAWF}{error_500_handler}->($self);
+ };
if($@) {
chomp( my $m = $@ );
warn "Error handler died as well, something is seriously wrong with your code. ($m)\n";