|
@@ -145,15 +145,35 @@ public enum ExceptionResultEnum {
|
|
|
}
|
|
|
|
|
|
public ApiException exception() {
|
|
|
+ try {
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("");
|
|
|
+ HttpServletRequest request = ServletUtil.getRequest();
|
|
|
+ stringJoiner.add("[error path]:").add(request.getServletPath()).add("\r\n");
|
|
|
+ stringJoiner.add("[status]:").add(String.valueOf(status.value())).add("\r\n");
|
|
|
+ stringJoiner.add("[code]:").add(String.valueOf(code)).add("\r\n");
|
|
|
+ stringJoiner.add("[message]:").add(message);
|
|
|
+ log.error(SystemConstant.LOG_ERROR, stringJoiner.toString());
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
return new ApiException(status, code, message, message);
|
|
|
}
|
|
|
|
|
|
+ private final static Logger log = LoggerFactory.getLogger(ExceptionResultEnum.class);
|
|
|
+
|
|
|
public ApiException exception(int code, String message) {
|
|
|
+ try {
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("");
|
|
|
+ HttpServletRequest request = ServletUtil.getRequest();
|
|
|
+ stringJoiner.add("[error path]:").add(request.getServletPath()).add("\r\n");
|
|
|
+ stringJoiner.add("[status]:").add(String.valueOf(status.value())).add("\r\n");
|
|
|
+ stringJoiner.add("[code]:").add(String.valueOf(code)).add("\r\n");
|
|
|
+ stringJoiner.add("[message]:").add(message);
|
|
|
+ log.error(SystemConstant.LOG_ERROR, stringJoiner.toString());
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
return new ApiException(status, code, message, message);
|
|
|
}
|
|
|
|
|
|
- private final static Logger log = LoggerFactory.getLogger(ExceptionResultEnum.class);
|
|
|
-
|
|
|
public ApiException exception(String message) {
|
|
|
try {
|
|
|
StringJoiner stringJoiner = new StringJoiner("");
|