参数优化

pull/138/head
koltZhang 2024-09-10 10:40:15 +08:00
parent 662e8bd02d
commit 8041df8d3f
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ import org.springframework.http.HttpStatus;
public class SentinelExceptionHandler implements BlockExceptionHandler {
@Override
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, String s, BlockException e) throws Exception {
public void handle(HttpServletRequest request, HttpServletResponse response, String resourceName, BlockException e) throws Exception {
String msg = "未知异常";
int status = HttpStatus.TOO_MANY_REQUESTS.value();
if (e instanceof FlowException) {
@ -36,7 +36,7 @@ public class SentinelExceptionHandler implements BlockExceptionHandler {
} else if (e instanceof SystemBlockException) {
msg = "系统规则限流或降级";
}
ServletUtils.writeJSON(httpServletResponse, CommonResult.error(status, msg));
ServletUtils.writeJSON(response, CommonResult.error(status, msg));
}