I have a try/catch block in a B4J project.
In the catch code Im just using this; Log(LastException)
But this is causing an exception of its own and the app is crashing. In the logs is the following;
Any idea why Log(LastException) isnt working in this case?
In the catch code Im just using this; Log(LastException)
But this is causing an exception of its own and the app is crashing. In the logs is the following;
B4X:
Caused by: java.lang.ClassCastException: class java.lang.Error cannot be cast to class java.lang.Exception (java.lang.Error and java.lang.Exception are in module java.base of loader 'bootstrap')
at anywheresoftware.b4a.BA.setLastException(BA.java:360)
at nz.ope.qonda.monitor.agent.bkg_collect_hostinfo._collect(bkg_collect_hostinfo.java:63)
at nz.ope.qonda.monitor.agent.bkg_collect_hostinfo._timer1_tick(bkg_collect_hostinfo.java:101)
at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
... 12 more
Any idea why Log(LastException) isnt working in this case?