Question
What are the advantages and disadvantages of exceptions with context vs nested exceptions?
Why I care
As a developer who doesn't have a background in or know the background of Java, I have stumbled upon a possible opportunity to update an open source project's exception handling, but I wish to ensure that the change I would make is beneficial.
The project in question is ddlutils. It currently uses org.apache.commons.lang.exception which states:
"Provides JDK 1.4 style Nested Exception functionality for those on prior Java versions."
The current version of Commons Lang (3.1 at time of writing) uses org.apache.commons.lang3.exception which states:
"Contains the concept of an exception with context i.e. such an exception will contain a map with keys and values. This provides an easy way to pass valuable state information at exception time in useful form to a calling process."