panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Exposing error class #137

Closed badeball closed 5 years ago

badeball commented 5 years ago

Hi,

Awesome job on the lib, @panva. I've really appriciated looking through the code and especially the tests, to learn what openid is.

I'm currently trying to test error paths in my application and want to assert that an error is in fact the expected openid error, preferably without checking the message text.

Would it be possibly for you to expose the error class, like you've done in the provider library?

Regards

Jonas

panva commented 5 years ago

Hi Jonas,

definitely, it's already part of 3.x (to be released, check out the browser-support branch wip).

panva commented 5 years ago

If you open a PR with that exact change i'll be happy to merge or just check for the error.name in the meantime.