It doesn’t have to provide a specific callback. This can be a starting point (Java):
var client = aClient() .onError((request,response) -> { LOG.debug(…); return FAIL; }).build();
return switch(response.code()) { case 429 -> RETRY; default -> FAIL; }