PeculiarVentures / PKI.js

PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.
http://pkijs.org
Other
1.25k stars 204 forks source link

Calls to Promise.reject should wrap strings in Error objects #339

Closed benpetermorris closed 2 years ago

benpetermorris commented 2 years ago

As it stands, we can't discern where the rejection happened in a catch statement, since the strings provide no stack trace.

Passing Error objects to Promise.reject would be much more useful.

microshine commented 2 years ago

I've published beta version of pkijs. Please try it. It fixes the issue

npm i pkijs@beta

# or

npm i pkijs@3.0.1-2