mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-14 22:29:00 +08:00
🔊 spring cloud gateway 异常输出日志堆栈 方便排查
This commit is contained in:
1 parent
30cd285b81
commit
d9882ae1e2
1 file changed
+1
+1
@@ -46,6 +46,7 @@ public class GlobalExceptionConfiguration implements ErrorWebExceptionHandler {
|
|||||||
return response.writeWith(Mono.fromSupplier(() -> {
|
return response.writeWith(Mono.fromSupplier(() -> {
|
||||||
DataBufferFactory bufferFactory = response.bufferFactory();
|
DataBufferFactory bufferFactory = response.bufferFactory();
|
||||||
try {
|
try {
|
||||||
|
log.error("Error Spring Cloud Gateway :", ex);
|
||||||
return bufferFactory.wrap(objectMapper.writeValueAsBytes(R.failed(ex.getMessage())));
|
return bufferFactory.wrap(objectMapper.writeValueAsBytes(R.failed(ex.getMessage())));
|
||||||
}
|
}
|
||||||
catch (JsonProcessingException e) {
|
catch (JsonProcessingException e) {
|
||||||
|
|||||||
Reference in new issue
Block a user