java异常处理

  • 必须捕获与非必须捕获异常。 用RuntimeException 抛出提示
        try {
         // todo
        } catch (Exception e) {
            String message = String.format("record=%s,keys=%s",checkPoints, args[1]);
            // System.err.println(message);
            // e.printStackTrace();
            throw new RuntimeException(message, e);
        }
posted @ 2021-08-13 12:08  bregman  阅读(27)  评论(0)    收藏  举报