Is it ok to instantiate an exception without throwing it?
<p>Suppose I have a MyException class that subclasses Exception. I'm using this class to include contextual information when errors occur in my code.</p>

<p>I typically use it to wrap one of the "standard" exception classes. For example, if an error happens during input validation, I will do something like</p>

<pre><code>if (invalidInput())
  throw new MyException(new IllegalArgumentException(), arg1, arg2, ...);
</code></pre>

<p>But my IDE (Intellij IDEA) warns me that instantiating an unchecked exception (IllegalArgumentException in this example) without throwing it is bad, but doesn't tell me why.</p>

<p>So how sinful is it to instantiate an exception without throwing it? To which circle of hell will I go?</p>
