Skip to content

Conversation

VolkerLieber
Copy link
Contributor

Removes the version dependent JSError throwing as discussed in #83 because the interface changed with facebook/react-native@0035cc9.
Tested on iOS with RN 0.67.4 and 0.70.0-rc.4 without errors.

@ospfranco ospfranco merged commit fb6e064 into ospfranco:main Sep 6, 2022
@ospfranco
Copy link
Owner

Published in 4.0.7

@ospfranco
Copy link
Owner

Hey I just tested this and using a c++ throw is not correct, it still throws the error inside of the C++ world and it is not catchable in JS...

@VolkerLieber
Copy link
Contributor Author

VolkerLieber commented Dec 4, 2022

You tried throw jsi::JSError(...)?

@ospfranco
Copy link
Owner

yeah, it seems to be working for some people but I'm not sure why... right now my current guess is it is version dependent 0.70.X branch might handle the error correctly

https://twitter.com/ospfranco/status/1599100728064122881

@VolkerLieber
Copy link
Contributor Author

Ok, so if I understand it correctly, catching the error in js is not working for <0.70, but it is working for >=0.70.
I'm currently a bit occupied with work, but will look into the problem and possible solutions tomorrow.

@ospfranco
Copy link
Owner

I just tried updating the sample project to 0.70 and it is still not working. No idea why is it working for the expo guy...

@ospfranco
Copy link
Owner

@ospfranco
Copy link
Owner

Oh... this is so weird. Maybe this isn't JSI weirdness but rather just JS weirdness...

Screenshot 001318

@ospfranco
Copy link
Owner

This is now beyond my comprehension. The error can be caught in the immediate function but the parent caller cannot catch anything...

Screenshot 001319

Screenshot 001320

@ospfranco
Copy link
Owner

ospfranco commented Dec 4, 2022

damnit, I had a tsc outputed file in there which was in js and somehow that was running... it seems now that the error is catched... but I don't really understand what was the change that made it work...

My best bet right now is that 0.70 does handle this correctly while 0.6X doesn't

@ospfranco
Copy link
Owner

https://stackoverflow.com/questions/51081892/nodejs-asynchronous-exceptions-are-uncatchable

This might be the cause as the transactions are being queued used setImmediate

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

Successfully merging this pull request may close these issues.

2 participants