RFR: 2059: Improve error message when cli encounters 401
Zhao Song
zsong at openjdk.org
Wed Oct 18 21:49:24 UTC 2023
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.
-------------
Commit messages:
- update
- SKARA-2059
Changes: https://git.openjdk.org/skara/pull/1571/files
Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1571&range=00
Issue: https://bugs.openjdk.org/browse/SKARA-2059
Stats: 35 lines in 5 files changed: 22 ins; 0 del; 13 mod
Patch: https://git.openjdk.org/skara/pull/1571.diff
Fetch: git fetch https://git.openjdk.org/skara.git pull/1571/head:pull/1571
PR: https://git.openjdk.org/skara/pull/1571
More information about the skara-dev
mailing list