🔊 spring cloud gateway 异常输出日志堆栈 方便排查

This commit is contained in:
lbw committed 2021-12-14 13:04:21 +08:00
1 parent 30cd285b81
commit d9882ae1e2
1 file changed
+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) {