@matheusbsbs / matheus-bagliano / commits / aa14013abf
Fork 0

gitweb: Add optional extra parameter to die_error, for extended explanation

Add a 3rd, optional, parameter to die_error to allow for extended error information to be output along with what the error was. Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John 'Warthog9' Hawley committed Jan 30, 2010 at 23:30 UTC aa14013abf27637dc2a2c0bee56fb98a981ee08d
1 file changed +7 -1
gitweb/gitweb.perl
+7 -1
@@ -3392,6 +3392,7 @@ sub git_footer_html {
3392 sub die_error {
3393 my $status = shift || 500;
3394 my $error = shift || "Internal server error";
3395 + my $extra = shift;
3396
3397 my %http_responses = (
3398 400 => '400 Bad Request',
@@ -3406,8 +3407,13 @@ sub die_error {
3407 <br /><br />
3408 $status - $error
3409 <br />
3409 -</div>
3410 EOF
3411 + if (defined $extra) {
3412 + print "<hr />\n" .
3413 + "$extra\n";
3414 + }
3415 + print "</div>\n";
3416 +
3417 git_footer_html();
3418 exit;
3419 }