From: cjwatson <> Date: Sat, 7 Dec 2002 09:44:30 +0000 (-0800) Subject: [project @ 2002-12-07 01:44:30 by cjwatson] X-Git-Tag: release/2.6.0~974 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f69511426e90b5f8e92e48a77dc918b25ae31966;p=debbugs.git [project @ 2002-12-07 01:44:30 by cjwatson] Improve the error message returned when querying non-existent bug numbers. --- diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index 3d90f776..0063ad98 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -31,14 +31,13 @@ my %pkgsrc = %{getpkgsrc()}; my $ref = $param{'bug'} || quit("No bug number"); $ref =~ /(\d+)/ or quit("Invalid bug number"); $ref = $1; +my $short = "#$ref"; my $msg = $param{'msg'} || ""; my $att = $param{'att'}; my $boring = ($param{'boring'} || 'no') eq 'yes'; my $reverse = ($param{'reverse'} || 'no') eq 'yes'; my $mbox = ($param{'mbox'} || 'no') eq 'yes'; -my %status = %{getbugstatus($ref)} or &quit("Couldn't get bug status: $!"); - my $indexentry; my $descriptivehead; my $showseverity; @@ -53,6 +52,23 @@ my $dtime = strftime "%a, %e %b %Y %T UTC", localtime; $tail_html = $debbugs::gHTMLTail; $tail_html =~ s/SUBSTITUTE_DTIME/$dtime/; +my %status = %{getbugstatus($ref)}; +unless (%status) { + print < + +$debbugs::gProject $debbugs::gBug report logs - $short + +

$debbugs::gProject $debbugs::gBug report logs - $short

+

There is no record of $debbugs::gBug $short. +Try the search page instead.

+$tail_html +EOF + exit 0; +} + $|=1; $tpack = lc $status{'package'}; @@ -102,8 +118,7 @@ if (length($status{done})) { $indexentry .= join(";\n", @descstates) . ";\n
" if @descstates; -my ($short, $tmaint, $tsrc); -$short = $ref; $short =~ s/^\d+/#$&/; +my ($tmaint, $tsrc); $tmaint = defined($maintainer{$tpack}) ? $maintainer{$tpack} : '(unknown)'; $tsrc = defined($pkgsrc{$tpack}) ? $pkgsrc{$tpack} : '(unknown)'; $descriptivehead= $indexentry."Maintainer for $status{package} is\n".