Open TimoGlastra opened 7 months ago
Looks good, yes!
I would still like to look at passing the backtrace of Rust along as well. Would be nice if we could create something custom that contains a jsStacktrace
and a rustStacktrace
or something like that.
When calling methods over FFI with a callback the error stack shows e.g. this:
It's not very helpful as it shows the callback stacktrace, losing the original call.
If we create a
new Error().stack
at the top level ofpromisifyWithResponse
(orpromisify
), and then pass this to the error handler and overwrite the stack of the error we get this:Which now conatins the actual method that was called. It's still not the most pretty but seeint that
NodeJSAriesAskar.storeProvision
failed in/Users/timo/Developer/Playground/askar-transaction-test/index.ts:8:29
is really helpfulWe can do this for all the wrappers. WDYT @genaris @berendsliedrecht?