Improve error information when the GitLab API version can't be found.
Review Request #10336 — Created Nov. 27, 2018 and submitted
Users working with self-hosted GitLab installs sometimes hit errors
saying the GitLab API version could not be found. While we attempt to
store the reasons this may occur, we never actually output them
anywhere, and when authenticating against the repository we prefix with
a redundant "Unknown error" and stack trace, which doesn't help matters
This redoes this error reporting to provide a more helpful, informative
error message that lists the causes we stored (hopefully providing some
context to this error), along with some helpful hints on what may have
gone wrong (URL resolution issues or SSL certificate trust issues).
They're no longer shown as unknown errors, and the logs aren't full of
scary stack traces.
The generic error handler for the repository form has also received some
very minor tweaks, saying "Unexpected error" instead of "Uknown error"
and saying that the log file "may" have additional details. It also
removes a logging stack trace, which became redundant with the addition
of a similar logging statement in
when generic SSL cert verification was introduced.
Added new unit tests, which pass.
Manually tested using some bad URLs and saw the more reasonable errors
without all the redundancy.
Removed an unused import.
Revision 2 (+95 -11)
Checks run (2 succeeded)