]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Add custom error handler using die_error
authorJakub Narebski <redacted>
Sat, 24 Apr 2010 14:00:04 +0000 (16:00 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
Change the default message for errors (for fatalsToBrowser) to use
die_error() subroutine.  This way errors (and explicitely calling 'die
MESSAGE') would generate 'Internal Server Error' error message.

Note that call to set_message is intentionally not put in BEGIN block;
we set error handler to use die_error() only after we are sure that we
can use it, after all needed variables are set.

Due to the fact that error handler set via set_message() subroutine
from CGI::Carp (in the fatalsToBrowser case) is called after HTTP
headers were already printed (with exception of MOD_PERL), gitweb
cannot return 'Status: 500 Internal Server Error'.

Thanks to the fact that die_error() no longer uses 'exit', errors
would be logged by CGI::Carp, independent on whether default error
handler is used, or handle_errors_html which uses die_error is used.

Signed-off-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>

No differences found
This page took 0.165418 seconds and 4 git commands to generate.