defines a class BusinessRunTimeException, that inherits RuntimeException. When captured by controller, the result of e instanceof BusinessRunTimeException judgment is returned to false
.related codes
Business layer throws an exception directly:
throw new BusinessRunTimeException();
Control layer capture:
try {
//
} catch (Exception e) {
if (e instanceof BusinessRunTimeException) {
BusinessRunTimeException b = (BusinessRunTimeException) e;
//
} else {
//
}
}