Exception handling on a per thread basis

The following applies to Tiger and above. Prior to Tiger, an uncaught exception would propagate from a Thread to its ThreadGroup, propagate up to the root ThreadGroup and print the trace. To circumvent this, we can now implement a nested interface of the Thread class called Thread.UncaughtExceptionHandler. You can create your own implementation of this interface to handle uncaught exceptions.
Note – prior to Tiger, we would have to create our own ThreadGroup, assign any Thread we create to this ThreadGroup and handle the uncaught exception in the ThreadGroup ( a lot of shit for nothing of substance)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: