咕泡大數(shù)據(jù)經(jīng)典算法與數(shù)據(jù)結(jié)構(gòu)應用指南
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 + "的數(shù)據(jù)的時候發(fā)生了異常", e);
? ? ? ?}
? ?}
標簽: