IllegalArgumentException, , :
if (invalidInput())
new IllegalArgumentException("Invalid argument " + x + ", expected ...");
IllegalArgumentException Exception, .
public class MyIllegalArgumentException extends IllegalArgumentException {
public MyIllegalArgumentException(Object arg...) { .... }
}
, .
Update:
- , Throwable , : , , .
if (invalidInput())
new IllegalArgumentException("Invalid argument " + x + ", expected ...", new MyContextException(a,b,c));
( a, b c - , ).
, () , , , , / .