this.handleException(exchange, throwable);
});```
in the above code i would like to return a custom response eg as below
{
“its failed”
}“`
I tried it by returning it in the handleException method
byte[] responseByte =
JsonUtils.getObjectMapper()
.writeValueAsString("its failed")
.getBytes(StandardCharsets.UTF_8);
exchange.getResponse().setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);
DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(responseByte);
return exchange.getResponse().writeWith(Flux.just(buffer));
But its not working and throwing the default exception