I’d like to use to a custom exception to have a user-friendly message come up when an exception of any sort takes place.
What’s a good straightforward way of doing this? Are there any extra precautions I should take to avoid interfering with Swing’s EDT?
Exception Translation:
It’s a good idea to not pollute your application with messages that have no meaning to the end user, but instead create meaningful Exceptions and messages that will translate the exception/error that happened somewhere deep in the implementation of your app.
As per @Romain’s comment, you can use Exception(Throwable cause) constructor to keep track of the lower level exception.
From
Effective Java 2nd Edition, Item 61: