咕泡大数据经典算法与数据结构应用指南
class TestException {
public static void main(String[] args) {
try {
processUserData();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static void processUserData() {
int userId = 1;
try {
insetIntoDatabase();
} catch (SQLException e) {
throw new UserAlreadyExistException("插入 id 为" + userId + "的数据的时候发生了异常", e);
}
}