RFR: 2059: Improve error message when cli encounters 401

Zhao Song zsong at openjdk.org
Thu Oct 19 14:56:48 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.

Thanks for the review!

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

PR Comment: https://git.openjdk.org/skara/pull/1571#issuecomment-1771156626


More information about the skara-dev mailing list