Closed CarlAmko closed 10 months ago
Have exhausted attempts to do this the good way, napi-rs just doesn't have an angle to get more fields in the generated JsError at this time, and we can't manually throw an error inside an async function (can't have injected env
there) which is where all the ngrok.Error's are generated from. So trailer.js
to the rescue again, have line-of-sight to attach an error code there.
Others trying to do the same thing:
Pull request: https://github.com/ngrok/ngrok-nodejs/pull/73
Previously, connect errors via Rust were returned as strings. They've now been augmented to include the ngrok error code as a field. We can now make this information more accessible to the high-level API calls.
See the parent issue for more details.