summaryrefslogtreecommitdiff
path: root/shell.c
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2010-04-24 14:00:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-01 19:09:58 (GMT)
commit7a59745710e964f9498f37a3184bf95b9b4a772b (patch)
treed0355d639d67e85fe10ed6b974b0fab1e8b52fea /shell.c
parentc42b00c8f2b8c04ff9829e88dcde92d7294cd460 (diff)
downloadgit-7a59745710e964f9498f37a3184bf95b9b4a772b.zip
git-7a59745710e964f9498f37a3184bf95b9b4a772b.tar.gz
git-7a59745710e964f9498f37a3184bf95b9b4a772b.tar.bz2
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 'shell.c')
0 files changed, 0 insertions, 0 deletions