我有下一个问题。
public Validator {
....
public boolean validate() throws MyException
....
if (!model.hasSomeCondition()) {
throw getException(model);
}
....
return true;
}
....
public MyException getException (MyModel aModel) {
MyException exception = new MyException(aModel.getFirstName());
return exception;
}
....
public static class MyException extends Exception {
...
}
....
}
当我捕获异常时,对象始终为空!
怎么了?我无法理解。
PS。感谢帮助。