]> Sergey Matveev's repositories - public-inbox.git/commitdiff
viewvcs: show message for 404||500 errors
authorEric Wong <e@80x24.org>
Tue, 24 Jan 2023 09:49:37 +0000 (09:49 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 Jan 2023 10:07:55 +0000 (10:07 +0000)
Since the debug log isn't present from the /$REPO/ URLs,
the lack of debug log makes 404s look confusing.

lib/PublicInbox/ViewVCS.pm

index 0dfe608191d234e01a357b69e5ca0d082f3158ce..99f5e24fb6be98cff0b63c6c6236e80e8f4b9bf0 100644 (file)
@@ -497,8 +497,9 @@ sub show_tag ($$) {
 sub solve_result {
        my ($res, $ctx) = @_;
        my $hints = delete $ctx->{hints};
-       $res or return html_page($ctx, 404, dbg_log($ctx));
-       ref($res) eq 'ARRAY' or return html_page($ctx, 500, dbg_log($ctx));
+       $res or return html_page($ctx, 404, 'Not found', dbg_log($ctx));
+       ref($res) eq 'ARRAY' or
+               return html_page($ctx, 500, 'Internal error', dbg_log($ctx));
 
        my ($git, $oid, $type, $size, $di) = @$res;
        return show_commit($ctx, $res) if $type eq 'commit';