Provide helpful instructions if RBTools is pointing to the wrong URL.

Review Request #10310 — Created Nov. 6, 2018 and updated

chipx86
RBTools
master
53fc034...
rbtools

There are a few cases in which people can end up with confusing error
messages when pointing RBTools to the wrong Review Board URL. For
instance, if they've pointed to something that has a /api/ URL, but
doesn't have a Review Board root API payload, they can get an
AttributeError. If they've pointed to an expired RBCommons team,
they'll get "Unexpected API Error: 404".

This updates our handling to better check for 404s and that the root API
payload has what we'd expect. If checks fail, we check if it's an issue
with an RBCommons-specific URL, providing instructions to help, and then
fall back on an error message explaining what's wrong and what URL
they're using.

Tested variations on RBCommons URLs, both valid and invalid.

Tested a non-Review Board URL that had a JSON /api/ endpoint.

Tested URLs that didn't look at all like Review Board servers.

Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...