RFR: 2059: Improve error message when cli encounters 401

Erik Joelsson erikj at openjdk.org
Thu Oct 19 14:09:09 UTC 2023


On Wed, 18 Oct 2023 21:25:13 GMT, Zhao Song <zsong at openjdk.org> wrote:

> As Erik said in the issue "A user tried to run `git pr checkout` and got UncheckedRestException with 401. The repository in question had remotes pointing to a gitlab instance while the user was trying to get a PR from github. Not sure if that is relevant here. We should not fail with a stacktrace but should rather explain that we authorization failed and print which URL we tried to connect to."
> 
> To not fail with a stack trace, in this patch, `UncheckedRestException` will be caught in the `GitSkara#main` and status code will be checked, if the status code is 401, the cli tool should print suitable error message to the user.

Marked as reviewed by erikj (Lead).

-------------

PR Review: https://git.openjdk.org/skara/pull/1571#pullrequestreview-1687846929


More information about the skara-dev mailing list