cli icon indicating copy to clipboard operation
cli copied to clipboard

Show more clear error when token cannot query some API

Open UmanShahzad opened this issue 2 years ago • 0 comments

If we get a 401 due to using a token that doesn't have permissions for that API, we should show a better error. Here's what we currently show:

$ ipinfo AS63989
err: GET https://ipinfo.io/AS63989: 401 { }

We should show an error similar to the one shown when you have no token at all:

$ ipinfo logout
logged out

$ ipinfo AS63989
err: ASN lookups require a token; login via `ipinfo login`.

UmanShahzad avatar Apr 11 '22 16:04 UmanShahzad