almatrass / passport-opskins

A simple passport strategy for authenticating users through the OPSkins platform
MIT License
4 stars 1 forks source link

Could you supply better error reporting? #2

Closed iDefineHD closed 5 years ago

iDefineHD commented 5 years ago

During my testing, i had no clue what the error was doing. it was a request error not being able to get the body. This would throw a generic error message. Could you maybe just tell the person to check that their api isn't disabled etc, or set up a case for that. Thanks.

almatrass commented 5 years ago

Hey,

Are you able to get the error again if you can and let me see so I can fix it.

Thanks

iDefineHD commented 5 years ago

Sorry. I didnt get notified or i would have replied. It is the generic error thrown. It was because my api key wasnt actually activated. So would error. All is good now.

iDefineHD commented 5 years ago

it was the error thrown by `

  request.get(options, (err, response, body) => {
    if (err)
      return cb(err);
    if (!isValidJson(body))
      return cb(new Error(`Invalid JSON response`));
    let realBody = JSON.parse(body);
    if (realBody.status !== 1)
      return cb(new Error(`An error occurred`));
    cb(null, realBody.response.clients);
  });

};`

almatrass commented 5 years ago

Oh yeah I'll change it so it gives the message sent by OPSkins too aha