File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
auto-configurations/common/spring-ai-autoconfigure-retry/src/main/java/org/springframework/ai/retry/autoconfigure Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1717package org .springframework .ai .retry .autoconfigure ;
1818
1919import java .io .IOException ;
20+ import java .net .URI ;
2021import java .nio .charset .StandardCharsets ;
2122
2223import org .slf4j .Logger ;
3031import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
3132import org .springframework .boot .context .properties .EnableConfigurationProperties ;
3233import org .springframework .context .annotation .Bean ;
34+ import org .springframework .http .HttpMethod ;
3335import org .springframework .http .client .ClientHttpResponse ;
3436import org .springframework .lang .NonNull ;
3537import org .springframework .retry .RetryCallback ;
4749 *
4850 * @author Christian Tzolov
4951 * @author SriVarshan P
52+ * @author Issam El-atif
5053 */
5154@ AutoConfiguration
5255@ ConditionalOnClass (RetryUtils .class )
@@ -87,13 +90,19 @@ public boolean hasError(@NonNull ClientHttpResponse response) throws IOException
8790 }
8891
8992 @ Override
93+ public void handleError (URI url , HttpMethod method , @ NonNull ClientHttpResponse response )
94+ throws IOException {
95+ handleError (response );
96+ }
97+
98+ @ SuppressWarnings ("removal" )
9099 public void handleError (@ NonNull ClientHttpResponse response ) throws IOException {
91100 if (!response .getStatusCode ().isError ()) {
92101 return ;
93102 }
94103
95104 String error = StreamUtils .copyToString (response .getBody (), StandardCharsets .UTF_8 );
96- if (error == null || error .isEmpty ()) {
105+ if (error .isEmpty ()) {
97106 error = "No response body available" ;
98107 }
99108
You can’t perform that action at this time.
0 commit comments