Suppose I have a MyException class that subclasses Exception. I'm using this class to include contextual information when errors occur in my code.
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
if (invalidInput())
throw new MyException(new IllegalArgumentException(), arg1, arg2, ...);
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.
So how sinful is it to instantiate an exception without throwing it? To which circle of hell will I go?