Hi all,
I am writing a program that will allow people to import data from various 3rd party apps. So far, the program is working great, but I’ve had one person accidentally crash the app with a corrupted data file. The program currently catches all of the errors that I could think of, (plus a few extras that I somehow overlooked), but still – is there a way to finally catch any overlooked, potential errors without allowing the app to crash? Anything like a … “catch all” as a last resort, just in case?
Thank you.
The App.UnhandledException
event is raised if you don’t catch one.
It’s a bad idea to suppress the quit behavior with a catch all. If you didn’t handle the exception, you have no idea what went wrong. It could be unsafe to continue. Additionally, I want users to email me when the app has a failure and I find suppressing the quit behavior discourages that.
Exactly, I fully agree… 
I just didn’t want the user seeing an ugly, cryptic error message (which they wouldn’t understand anyway) throw up on their screen. I’d rather put up an message stating that this file could not be opened due to file corruption – and to give me a call, so I could take a look at what happened. 
Xojo does support Finally.
IIRC you could shove the exception from your Catch statement in to a RuntimeException then check its type and properties. This would allow you to do something like:
try
raise new NilObjectException
Catch e as RuntimeException
if e isa StackOverflowException then
break
elseif e isa NilObjectException then
break
Else
break
end if
end try
Untested, off the top of my head.