summaryrefslogtreecommitdiff
path: root/t/diff-lib.sh
diff options
context:
space:
mode:
authorLibravatar Jakub Narebski <jnareb@gmail.com>2010-04-24 16:00:04 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-05-01 12:09:58 -0700
commit7a59745710e964f9498f37a3184bf95b9b4a772b (patch)
treed0355d639d67e85fe10ed6b974b0fab1e8b52fea /t/diff-lib.sh
parentgitweb: Use nonlocal jump instead of 'exit' in die_error (diff)
downloadtgif-7a59745710e964f9498f37a3184bf95b9b4a772b.tar.xz
gitweb: Add custom error handler using die_error
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 <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/diff-lib.sh')
0 files changed, 0 insertions, 0 deletions