You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
err.toString returned from getToken will throw illegal access exception #382
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).
+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.
Activity
ahuntcirruspath commentedon Mar 11, 2015
+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".
ashaffer commentedon Mar 27, 2015
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
JustinBeckwith commentedon Mar 4, 2018
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!