I am using Application_Error event to capture all errors. But it cannot capture errors happened in resumable subs. Is there a way to fix this?
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Log(Error)
Log(StackTrace)
Return False
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
wait for (test) complete (done As Object)
End Sub
Private Sub test As ResumableSub
Sleep(0)
Dim i As Int = "A"
Return ""
End Sub
Sub Button1_Click
xui.MsgboxAsync("Hello World!", "B4X")
End Sub