-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: API
-
3 - M (<= 1 month)
-
2626
Description
As seen in https://github.com/realm/realm-dotnet/issues/1978, if we throw an exception in a managed function called by native, that will result in a pretty hard crash. We should revisit where we invoke managed callbacks from native and figure out whether errors need to be returned and rethrown "somewhere"
Example code that will cause an issue:
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
realm.Changed += (s, e) => { throw new Exception("aaa"); };
We should probably design a system where managed callbacks either swallow/log all exceptions or return a pointer to the exception in native, which is then rethrown back in managed at some point.
How important is this improvement for you?
No response