ThreadEndException

From Xojo Documentation

Revision as of 20:39, 16 October 2018 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from RuntimeException)

A ThreadEndException is raised when a Thread is closing. Usually you do not see the ThreadEndException unless you use a "catch-all" Exception statement.

Properties
ErrorNumber Message
Methods
Stack StackFrames

Notes

NOTE: Whenever you inadvertently catch an ThreadEndException, you MUST re-raise it. Failing to do so will mess up the runtime environment and lead to unpredictable problems. See Exception statement for more information about its proper use.


An Exception block can catch a ThreadEndException when you use a catch-all exception statement, i.e. "Exception err as RuntimeException" instead of giving a more specific runtime exception class. In such a case, you MUST re-raise the exception to avoid messing up the runtime environment and create some unpredictable problems.

Exception err As RuntimeException // Will catch any exception without discrimination
If err IsA EndException Or err IsA ThreadEndException Then
Raise err // Re-raise the exception
End If

//Continue your code here

See Also

RuntimeException class; Function, Raise statements; Nil datatype; Exception, Try statements.