What does you code do if you have an exception inside App.UnhandledException itself?
Other ideas:
- possibly you are having a Cocoa exception which can cause a method to silently exit - run your app with Console.log open and your appās name in the search box.
- Or, you could try making sure your app quits on exceptions: See Crash an application on NSException - #2 by Scott_Cadillac (Though, I think this already happens on High Sierra?)
- add this line as the very first line of app.UnhandledException:
system.debugLog "unhandled exception!!!"
(just to prove to yourself this handler is or is not firing)
Could it be that in the App.UnhandledException you have a NilObjectException causing it to be skipped or hard crashing?
So maybe you could put this above in the App.UnhandledException:
Var exception_type As String = Introspection.GetType(err).Fullname
system.log system.loglevelcritical, "!<>! " + CurrentMethodName + ", " + exception_type + ", " + err.message
Then run it with Console.App open and filter on ā!<>!ā
My guess is that it is occurring in a control, and potentially from a declare or plugin, maybe even on a different thread, so for some reason itās skipping the built-in Exception handling code from Xojo.
@Beatrix_Willius
I donāt see anything above soā¦ are you returning True or False from the UnhandledException method? Iām asking because if returning False (or nothing) trying to show a window will outright fail because the app will be allowed to crash.
Thatās a really good question. I donāt think I ever had the UnhandledException fire. At all. I tried with a method where I commented out the exception handler
dim f as FolderItem
f.Delete
'exception exc
'theException = new ErrorException(exc, currentMethodName)
But even there I get the normal exception behaviour.
Anyways. I wrangled with the SVN. Whatever I merged from before the NOE with the current version all is now good.
So sadā¦ Now weāll never know what went wrong
Just Murphy paying a brief visit.
Murphy always returnsā¦ best to say hi and have a long discussion with him whenever you can.