According to the reference documentation, the RestClient introduced in Spring 6 "throws a subclass of RestClientException when retrieving a response with a 4xx or 5xx status code".
The API documentation of RestClientException currently only mentions RestTemplate, it would be helpful if there was a referral to RestClient here as well.