This commit is contained in:
Administrator
2024-05-13 00:10:36 +08:00
parent dfe24ac601
commit 9d92554fc4

View File

@@ -1,4 +1,4 @@
package com.demo.gateway.config; package com.demo.gateway.exception;
import org.springframework.boot.web.reactive.error.ErrorAttributes; import org.springframework.boot.web.reactive.error.ErrorAttributes;
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler; import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler;
@@ -13,7 +13,7 @@ import reactor.core.publisher.Mono;
public class CustomErrorWebExceptionHandler { public class CustomErrorWebExceptionHandler {
@Bean @Bean
public ErrorWebExceptionHandler errorWebExceptionHandler(ErrorAttributes errorAttributes) { public ErrorWebExceptionHandler errorWebExceptionHandler123(ErrorAttributes errorAttributes) {
return (exchange, ex) -> { return (exchange, ex) -> {
if (ex instanceof ResponseStatusException) { if (ex instanceof ResponseStatusException) {
ResponseStatusException responseStatusException = (ResponseStatusException) ex; ResponseStatusException responseStatusException = (ResponseStatusException) ex;