Skip to content

Commit

Permalink
Merge pull request #217 from 17629354490/master
Browse files Browse the repository at this point in the history
sync springboot modify
  • Loading branch information
17629354490 authored Jul 2, 2024
2 parents ac6b43d + 6923bf6 commit 23be7cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3929,7 +3929,7 @@ <h4 id="jdbc_批量插入性能问题"><a class="anchor" href="#jdbc_批量插
</div>
<div id="footer">
<div id="footer-text">
Last updated 2024-03-13 11:21:58 +0800
Last updated 2024-07-02 14:15:36 +0800
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils;
Expand Down Expand Up @@ -98,9 +99,10 @@ public Object error(HttpServletRequest request) throws InvocationTargetException
} else {
path = ((RequestFacade) ((ServletRequestWrapper) request).getRequest()).getRequestURI();
}
int httpCode = (int) error.getOrDefault("status", -1);
HttpStatus httpStatus = getStatus(request);
int httpCode = httpStatus.value();
String message = error.getOrDefault("message", "").toString();
String exMsg = (String) error.getOrDefault("error", "");
String exMsg = httpStatus.getReasonPhrase();
List exDetail = null;
if (error.containsKey("errors") && !((List) error.get("errors")).isEmpty()) {
exDetail = (List) error.get("errors");
Expand Down Expand Up @@ -184,7 +186,7 @@ private static Object[] error(HttpServletRequest request,
busCode, message);
var resp = StandardResp.custom(busCode, path, String.format("[%s]%s", exMsg, message));
String body = $.json.toJsonString(resp);
return new Object[] {httpCode, body};
return new Object[]{httpCode, body};
}

/**
Expand Down

0 comments on commit 23be7cb

Please sign in to comment.