修复 token过期时访问网关返回500状态码

This commit is contained in:
zlt2000
2021-04-23 21:22:32 +08:00
parent 338690c85b
commit 19d9187646
@@ -3,6 +3,7 @@ package com.central.gateway.error;
import org.springframework.boot.autoconfigure.web.ErrorProperties;
import org.springframework.boot.autoconfigure.web.ResourceProperties;
import org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler;
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.reactive.error.ErrorAttributes;
import org.springframework.context.ApplicationContext;
import org.springframework.http.HttpStatus;
@@ -31,7 +32,7 @@ public class JsonErrorWebExceptionHandler extends DefaultErrorWebExceptionHandle
* 获取异常属性
*/
@Override
protected Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
protected Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
Throwable error = super.getError(request);
return responseError(request, error);
}