facebook/hermes

Catch JSErrors in C++

jacobp100 opened this issue · 1 comments

Problem

I've got a library that can use Hermes directly to run a web-worker-like environment in React Native

I make use of asyncTriggerTimeout to terminate workers. I'd expect to be able to catch these errors as JSError - but I can't work out how to actually do this

I added code I think should work, and some breakpoints. I can see the error is indeed the JSError instance I'm expecting - but I can't seem to be able to access it as anything other than a std::exception

I have some code here. Note it also handles JSC - hence the macros.

image

Any help would be greatly appreciated!

Solution

Additional Context