From 15a6c7ebdf31cfdaf50db52ca49861065d079f50 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 20 Jan 2016 15:07:18 +0800 Subject: Bug 1231918 - error handler doesn't close multi-part responses --- Bugzilla/Sentry.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Sentry.pm b/Bugzilla/Sentry.pm index e9dedc8dd..d49eb0808 100644 --- a/Bugzilla/Sentry.pm +++ b/Bugzilla/Sentry.pm @@ -332,7 +332,12 @@ sub _sentry_die_handler { # if we are called via CGI::Carp::die chances are something is seriously # wrong, so skip trying to use ThrowTemplateError if (!$in_cgi_carp_die && !$is_compilation_failure) { - eval { Bugzilla::Error::ThrowTemplateError($message) }; + eval { + my $cgi = Bugzilla->cgi; + $cgi->close_standby_message('text/html', 'inline', 'error', 'html'); + Bugzilla::Error::ThrowTemplateError($message); + print $cgi->multipart_final() if $cgi->{_multipart_in_progress}; + }; $nested_error = $@ if $@; } -- cgit v1.2.3-24-g4f1b