Re: [PATCH 6/6] coverity: detect and report when the token or project is incorrect
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 25, 2023, 11:52 UTC
- Message-ID
- <f1c818a8-5b18-58f5-ec42-45eb8ad3e00b@gmx.de>
- In-Reply-To
- <20230923070735.GC1471672@coredump.intra.peff.net>
Hi Jeff,
On Sat, 23 Sep 2023, Jeff King wrote:
Show 14 quoted lines
> On Fri, Sep 22, 2023 at 10:42:03AM +0000, Johannes Schindelin via GitGitGadget wrote: > > > From: Johannes Schindelin <johannes.schindelin@gmx.de> > > > > When trying to obtain the MD5 of the Coverity Scan Tool (in order to > > decide whether a cached version can be used or a new version has to be > > downloaded), it is possible to get a 401 (Authorization required) due to > > either an incorrect token, or even more likely due to an incorrect > > Coverity project name. > > > > Let's detect that scenario and provide a helpful error message instead > > of trying to go forward with an empty string instead of the correct MD5. > > Ah. :) I think using "curl --fail" is probably a simpler solution here.
Apart from the unintuitive error message. I myself was puzzled and struggled quite a few times until I realized that it was not the token that was incorrect, but the project name.
To help people with a similar mental capacity to my own, I would therefore really want to keep this here patch.
As a compromise, I will switch to using `--fail` and then looking at the exit code (with 22 indicating authentication issues).
Ciao, Johannes