When an exception occurs in an async or event handler, capture the exception, and make it available to the application. For example, an OnCompleted handler for InvokeMethodAysnc call might throw an exception. Or an OnSomeEvent handler for an SubscribeToEvents call might throw an exception.
One way to address this is to add an optional parameter to GetwwDotnetBridge, which takes an object with a function called OnDotnetBridgeError, which will be called for each error. If the optional parameter isn't passed or OnDotnetBridgeError can't be called, the bridge will output the error to the console as an alternative. Such an approach would allow production apps to capture the error for diagnostics, with reasonable fallback notification for scenarios where setting up an error notification handler is overkill.
When an exception occurs in an async or event handler, capture the exception, and make it available to the application. For example, an
OnCompleted
handler forInvokeMethodAysnc
call might throw an exception. Or anOnSomeEvent
handler for anSubscribeToEvents
call might throw an exception.One way to address this is to add an optional parameter to
GetwwDotnetBridge
, which takes an object with a function calledOnDotnetBridgeError
, which will be called for each error. If the optional parameter isn't passed or OnDotnetBridgeError can't be called, the bridge will output the error to the console as an alternative. Such an approach would allow production apps to capture the error for diagnostics, with reasonable fallback notification for scenarios where setting up an error notification handler is overkill.Split from #13.