Skip to content

Instantly share code, notes, and snippets.

View aolshevskiy's full-sized avatar
👽

Artyom Olshevskiy aolshevskiy

👽
View GitHub Profile

Two approaches to handle error responses from Spring WebClient calls globally:

  • Exceptions with webclients are all wrapped in WebClientResponseException class. So we can handle that using Spring's ExceptionHandler annotation.

  • Using ExchangeFilterFunction while constructing the webclient bean.