Commit 343653b9 authored by xiaozhe.chen's avatar xiaozhe.chen

修改异常信息捕获返回的message

parent a9a40947
......@@ -6,6 +6,7 @@ import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus;
import cn.quantgroup.cashloanflowboss.core.exception.ApplicationException;
import com.fasterxml.jackson.core.io.JsonEOFException;
import com.fasterxml.jackson.databind.JsonMappingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.stereotype.Component;
......@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
* <p>
* Created by WeiWei on 2017/5/2.
*/
@Slf4j
@Order(1)
@Component
@RestControllerAdvice
......@@ -102,7 +104,10 @@ public class ApplicationExceptionConfiguration {
}
}
return new Result<>(ApplicationStatus.INTERNAL_SERVICE_ERROR, ApplicationException.class.isAssignableFrom(e.getClass()) ? cause.getMessage() : e.getMessage());
String errorMessage = ApplicationException.class.isAssignableFrom(e.getClass()) ? cause.getMessage() : e.getMessage();
log.error("程序员开小差了,异常信息:{}", errorMessage);
return new Result<>(ApplicationStatus.INTERNAL_SERVICE_ERROR, ApplicationStatus.INTERNAL_SERVICE_ERROR.getMessage());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment