jonasroussel / dart_jsonwebtoken

A dart implementation of the famous javascript library 'jsonwebtoken'
MIT License
87 stars 29 forks source link

Remove try catch block that prevents usable errors #2

Closed Hannnes1 closed 3 years ago

Hannnes1 commented 3 years ago

The try catch block that wrapped all other code in the verify method previously catches all useful errors that are thrown, and instead throws the same error all the time, which is not very useful.

jonasroussel commented 3 years ago

Hello,

For my purposes, this try catch block was useful to have a clean lib and normalizing errors. (I must need to add more JWTError) But I understand why you need to remove it. I will not do that, but I will add an option in the verify function to passthrough every errors inside this catch block.

This new version will be online in 1h.

Hannnes1 commented 3 years ago

Okay, that's fine. In my opinion I prefer the flexibility of being able to handle the errors differently on the front-end, but i see your point

jonasroussel commented 3 years ago

BREAKING CHANGE for v2.1.0

https://pub.dev/packages/dart_jsonwebtoken/changelog