help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnatsweb 2.7beta ignoring some server errors + fix


From: Yngve Svendsen
Subject: Re: gnatsweb 2.7beta ignoring some server errors + fix
Date: Tue, 01 May 2001 23:06:10 +0200

At 17:27 21.03.2001 -0800, G. Paul Ziemba wrote:
When I submit an edit (sub submitedit), sometimes the gnats
server returns an error to the lock command (e.g., "490 ...").
Gnatsweb did not catch that error, and eventually generated a
misleading error message to the effect that:

    &$err_sub("PR $pr has been modified since you started editing it.",
        "Please return to the edit form, press the Reload button, "
        . "then make your edits again.\n"
        . "<pre>Last-Modified was    '$fields{'Last-Modified'}'\n"
        . "Last-Modified is now '$oldfields{'Last-Modified'}'</pre>\n");

because %oldfields did not have any significant values in it.

My fix was to modify lockpr to look for an undef returned by
client_cmd("lock $pr $user") and to then return undef itself
in that case. Further, to modify submitedit to detect an "undef"
return from lockpr and then to call &$err_sub with $gnats::FULL_ERRSTR
to print the server error to the user.

I am sure my quick hack is not the best approach to this problem,
so I am sending merely this explanation in hopes that Gerald or
someone else can generate a better fix.

Thanks for reporting this. This seems to happen only when the locking of the PR just before the LOCKED block in submitedit fails. The error handling routine was simply missing, and this is a consequence of the somewhat unfinished move of all gnatsd-related code to the gnats.pm module.

I added error handling for this in 2.8.0, returning the proper "PR locked" error message. The Gnatsweb from the Gnats 4 CVS does not seem to suffer from these problems.

Now, I'll just have to find out how the lock file got there in the first place...

Yngve Svendsen
IS Engineer
Clustra AS, Trondheim, Norway
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]