2017년 11월 27일 월요일

filtering custom exception stacktrace

When you are using custom exception class,
there are a lot of stacktrace when it occurred.
So we can override the method named fillInStackTrace() as below.

 @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }

After that, when exception occured, it shows just exception message.

Caused by: org.blog.test.common.CustomException: custom exception occured

all the example is in the below url.

https://gitlab.com/shashaka/custom-exception-project

댓글 없음 :

댓글 쓰기