NilsIrl / MozWire

MozWire is an unofficial configuration manager giving Linux, macOS users (among others), access to MozillaVPN.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better error message on failed token auth

JohnCMoon opened this issue · comments

Currently, if you have a malformed MOZ_TOKEN variable, the error that comes back is:
Format is Authorization: Bearer [token]

To me, it's not immediately obvious that there might be a problem with my token...
Maybe it would be good to add a line in that block with a more clear error message?

            if !response.status().is_success() {
                eprintln!("Token authentication failed");
                response.json::<Error>().unwrap().fail();
            }

Cheers!