sd-jwt-js icon indicating copy to clipboard operation
sd-jwt-js copied to clipboard

fix: status list error handling

Open cre8 opened this issue 2 weeks ago • 4 comments

Improvement to https://github.com/openwallet-foundation/sd-jwt-js/pull/332

  • rename exception to long form to make it clear
  • if a custom error instance is thrown, it will be wrapped. if it's a status list exception, it will be passed

Signed-off-by: Mirko Mollik [email protected]

cre8 avatar Nov 25 '25 07:11 cre8

  • if a custom error instance is thrown, it will be passed. If not, it will be wrapped

By custom error instance, do you mean the StatusListException? If not, then the code is doing the opposite.

charsleysa avatar Nov 25 '25 07:11 charsleysa

  • if a custom error instance is thrown, it will be passed. If not, it will be wrapped

By custom error instance, do you mean the StatusListException? If not, then the code is doing the opposite.

Updated the description. I want to avoid the problem that you had: when the custom verify function is used, it needs to be wrapped to see if it was thrown during the status list verification.

If you want your custom message, it has to be of type statuslist exception

cre8 avatar Nov 25 '25 08:11 cre8

Erorr cause should be available in All modern browsers and Node.JS. I'm not sure about React Native.

We use a polyfill for it, but that was from 4 years ago, and it might not be needed anymore now.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause

TimoGlastra avatar Nov 27 '25 03:11 TimoGlastra

Erorr cause should be available in All modern browsers and Node.JS. I'm not sure about React Native.

We use a polyfill for it, but that was from 4 years ago, and it might not be needed anymore now.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause

Thanks for the useful resource, I update the extension classes to it.

cre8 avatar Nov 29 '25 10:11 cre8