-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
err.toString returned from getToken will throw illegal access exception #382
Comments
+1 I have a similar scenario and found that it's due to the body.error_description issue. For me, "illegal access" was actually the error from the Error object and not the api. It can be found in "google-auth-library/lib/transporters.js" file near line 78. When I change body.error_description to body.error, I got the appropriate api error: "invalid grant". |
This is definitely a consequence of .type being set on an Error instance. I am having this issue as well. Really needs to be fixed, it's extremely difficult to debug, as node doesn't offer a stack trace for it. Reference for the .type issue in node: http://www.karadzhov.com/2014/06/nodejs-and-illegal-access-error.html |
This appears to be fixed in the latest version. I now get an error like this:
Let me know if you're still running into any problems! |
I accidentally set the wrong redirect url and when I call oauth2Client.getToken, I expect I can get some related error message like redirect_uri_mismatch.
But instead I got illegal access exception when I do console.log(err).
b6fcdf3
Maybe it is because setting err.type = body.error while body.error_description is empty in this case?
The text was updated successfully, but these errors were encountered: