I have config the spring cloud gateway hystrix as below:
default-filters:
- name: Hystrix
args:
name: defaultGatewayCommand
fallbackUri: forward:/hystrix-fallback
The problem is, for example, when I throw ResponseStatusException exception in my project, the hystrix fallback will be triggered.
@GetMapping("/hystrix-fallback")
public Mono<ApiErrorResponse> hystrixFallback() {
return Mono.just(new ApiErrorResponse("xxxxxxxx"));
}
I want to catch some error info and build my new ApiErrorResponse, but i don 't how to do it?