<p>Would it be benefical to add a generic way to add info to a Throwable without creating a new Throwable?</p>

<p>I often see code like this:</p>

<pre><code>try {
    foo();
} catch (Exception e) {
    throw new Exception(e.getMessage() + " extra info=" + blah, e);
}
</code></pre>

<p>Would it be better to instead add <code>Throwable.setProperty(String key, String value)</code> so that the code above becomes the following?</p>

<pre><code>try {
    foo();
} catch(Exception e) {
    e.setProperty("extra info", blah);
    throw e;
}
</code></pre>

<p>The extra info could print (one per line) between the message and stack list.</p>

<p>Benefits:
 1. Would not require creating new <code>Throwable</code>s just to add extra information.
 2. Stack traces would not have multiple layers of cause traces
    (and therefore be easier to read)
 3. Reduce cost of creating extra stack traces.</p>

In general, I think that it is better to use the standard idioms in cases like this. In this case, the standard idiom is to wrap the exception, like this:
```
```
try {
  foo();
} catch (Exception e) {
  throw new MySpecificException("extra info=" + blah, e);
}
```
```
Also, in general it is best not to catch generic Exceptions. If you want to catch and add information to RuntimeException, then do that, and create a new RuntimeException. Otherwise, think carefully about which checked exceptions you want to catch and throw.