Of course, there is an UnhandledException event in the app which should handle the exception. But that should show a nice window.
When I set a breakpoint in the Close event of the window then the exception is already shown. So the exception must occur somewhere below in the hierarchy. But the window has dozens of containers.
I tried to revert to a version from last week. But I get the exception there, too, in spite of having not changed much.
I only get the exception on High Sierra but not Monterey.
And to really spite me the app doesn’t even crash at all after the exception window is shown.
Normally when this happens you’d want to try put some breakpoints and see after which it’s more likely to happen to narrow things down. We just ask the user to send it to the developers (including the stack etc).
As DerkJ said, try to see what you get in the stack, I get as well nasty errors like that randomly and find some eventually but not all but the stack helps to point at least the location, you need more details than that . I have the feeling that App.UnhandledException is not always firing as I get cases where same as you have code there but it never reaches that, I just remember that you need to return a true or false to break the app and get the rest
Yes, that’s the case here. I’ve done a full checkout of the SVN for the last known good version. I need to wrestle with the SVN to overwrite the bad commits. Then I’ll do the changes again one by one.
Since App.UnhandledException isn’t firing - something I find unusual, but I’ll take your word for it - you’ll need to use Try/Catch to find the exception. Wrap it around the close statement. If this happens when closing the window using the close box, consider adding a button to the window temporarily:
Sub PushButton1_Action()
Try
Self.Close
Catch Err As RuntimeException
// Look at Err here
End Try
End Sub
This should catch any deeper exception, and the stack property of Err should give you some clues.
Ok look for runtimeexception (catch all) handlers (end of methods) that may not be forwarding the exception or look for the text (parts) of the messagebox you getting.