Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

InternalOAuthError swallows exception details #113

Open
haf opened this issue Aug 30, 2019 · 0 comments
Open

InternalOAuthError swallows exception details #113

haf opened this issue Aug 30, 2019 · 0 comments

Comments

@haf
Copy link

haf commented Aug 30, 2019

I'm developing a site using passport-oauth2 (awesome!), however, when testing it in k8s I have different URI endpoints for the oauth2 server (internal DNS name); this caused this error:

 InternalOAuthError: Failed to obtain access token
     at OAuth2Strategy._createOAuthError (/app/node_modules/passport-oauth2/lib/strategy.js:408:17)
     at /app/node_modules/passport-oauth2/lib/strategy.js:175:45
     at /app/node_modules/oauth/lib/oauth2.js:191:18
     at ClientRequest.<anonymous> (/app/node_modules/oauth/lib/oauth2.js:162:5)
     at ClientRequest.emit (events.js:193:13)
     at TLSSocket.socketErrorListener (_http_client.js:397:9)
     at TLSSocket.emit (events.js:193:13)
     at emitErrorNT (internal/streams/destroy.js:91:8)
     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
     at processTicksAndRejections (internal/process/task_queues.js:81:17)

Based on that stacktrace, what happened? It would be much better to concatenate the inner error as the message of the thrown error, rather than forcing the global error handler to reflect properties on the error instance.

So this issue is about that; prefer usability.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant