diff --git a/ruoyi-extend/ruoyi-isc-gateway/src/main/java/com/ruoyi/gateway/filter/CustomerGlobalFilter.java b/ruoyi-extend/ruoyi-isc-gateway/src/main/java/com/ruoyi/gateway/filter/CustomerGlobalFilter.java index 8e7bfbe61..f1ab64976 100644 --- a/ruoyi-extend/ruoyi-isc-gateway/src/main/java/com/ruoyi/gateway/filter/CustomerGlobalFilter.java +++ b/ruoyi-extend/ruoyi-isc-gateway/src/main/java/com/ruoyi/gateway/filter/CustomerGlobalFilter.java @@ -97,7 +97,7 @@ public class CustomerGlobalFilter implements GlobalFilter, Ordered { } else if (MediaType.APPLICATION_FORM_URLENCODED.equals(mediaType)) { return handlePostRequestFormUrlencoded(exchange, route, request, accessKeyName, headerAk, body); } - throw new ContentTypeNotSupportedException(); + return Mono.error(ContentTypeNotSupportedException::new); }); return GatewayUtils.modifyBody(exchange, chain, modifiedBody); } @@ -312,7 +312,7 @@ public class CustomerGlobalFilter implements GlobalFilter, Ordered { } setResponseStatus(exchange, HttpStatus.TOO_MANY_REQUESTS); exchange.getResponse().setComplete(); - throw new RateLimitException(limit.intValue(), 1, timeUnit); + return Mono.error(new RateLimitException(limit.intValue(), 1, timeUnit)); }); } }