79266945

Date: 2024-12-10 03:39:12
Score: 1
Natty:
Report link
  1. WebClient considers response with error status codes (eg: 4xx, 5xx) as an exception.
  2. Because of throwing an exception (in this case), the exception handler of spring will return status code 500.

If you want to handle a specific WebClient response status code, use ExchangeFilterFunction to customize it with your exception type. (see this)

Then define the exception handler (scope spring) for this exception. (see this)

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Anthony Nguyen