Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch JSErrors in C++ #1472

Closed
jacobp100 opened this issue Aug 13, 2024 · 1 comment
Closed

Catch JSErrors in C++ #1472

jacobp100 opened this issue Aug 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jacobp100
Copy link
Contributor

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

@jacobp100 jacobp100 added the enhancement New feature or request label Aug 13, 2024
@jacobp100
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant