Commit 7a59745
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>1 parent c42b00c commit 7a59745
1 file changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
955 | 970 | | |
956 | 971 | | |
957 | 972 | | |
| |||
3167 | 3182 | | |
3168 | 3183 | | |
3169 | 3184 | | |
| 3185 | + | |
3170 | 3186 | | |
3171 | 3187 | | |
3172 | 3188 | | |
| |||
3194 | 3210 | | |
3195 | 3211 | | |
3196 | 3212 | | |
3197 | | - | |
| 3213 | + | |
| 3214 | + | |
3198 | 3215 | | |
3199 | 3216 | | |
3200 | 3217 | | |
| |||
3411 | 3428 | | |
3412 | 3429 | | |
3413 | 3430 | | |
| 3431 | + | |
3414 | 3432 | | |
3415 | 3433 | | |
3416 | 3434 | | |
| |||
3419 | 3437 | | |
3420 | 3438 | | |
3421 | 3439 | | |
3422 | | - | |
| 3440 | + | |
3423 | 3441 | | |
3424 | 3442 | | |
3425 | 3443 | | |
| |||
3433 | 3451 | | |
3434 | 3452 | | |
3435 | 3453 | | |
3436 | | - | |
| 3454 | + | |
| 3455 | + | |
3437 | 3456 | | |
3438 | 3457 | | |
3439 | 3458 | | |
| |||
0 commit comments