com.baidu.unbiz.fluentvalidator.exception
类 RuntimeValidateException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.baidu.unbiz.fluentvalidator.exception.RuntimeValidateException
- 所有已实现的接口:
- Serializable
public class RuntimeValidateException
- extends RuntimeException
验证器抛出运行时异常
所有验证过程中发生的异常会被这个运行时异常包装,验证调用点可以显示捕获,并且拿到内部的实际异常。一种典型的使用方法如下:
try {
Result ret = FluentValidator.checkAll().failFast()
.on(car.getLicensePlate(), new CarLicensePlateValidator())
.doValidate().result(toSimple());
} catch (RuntimeValidateException e) {
assertThat(e.getCause().getMessage(), is("Call Rpc failed"));
}
- 作者:
- zhangxu
- 另请参见:
- 序列化表格
| 从类 java.lang.Throwable 继承的方法 |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
RuntimeValidateException
public RuntimeValidateException()
RuntimeValidateException
public RuntimeValidateException(String message)
RuntimeValidateException
public RuntimeValidateException(String message,
Throwable cause)
RuntimeValidateException
public RuntimeValidateException(Throwable cause)
Copyright © 2015–2016 neoremind. All rights reserved.