地质所 沉降监测网建设项目
zmk
2024-07-03 41750848c6cc6506fa107036d04b28c0f28cfba8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.javaweb.common.utils.thread.exception.util;
 
/**
 * 默认异常信息格式化工具
 * @author zengyuanjun
 *
 */
public class DefaultExceptionMsgHandler implements ExceptionMessageFormat {
 
    private DefaultExceptionMsgHandler() {
    }
    
    private static class SingletonHolder{
        private static final DefaultExceptionMsgHandler instance = new DefaultExceptionMsgHandler();
    }
    
    public static DefaultExceptionMsgHandler getInstance(){
        return SingletonHolder.instance;
    }
    
    /**
     * 格式化异常信息
     */
    @Override
    public String formate(Exception e) {
        return e.getMessage() + "\n";
    }
 
}