|
16 | 16 | import org.springframework.transaction.annotation.Transactional;
|
17 | 17 | import org.springframework.web.client.HttpClientErrorException;
|
18 | 18 | import org.springframework.web.client.HttpServerErrorException;
|
| 19 | +import org.springframework.web.client.HttpStatusCodeException; |
19 | 20 | import org.springframework.web.client.RestTemplate;
|
20 | 21 |
|
21 | 22 | import com.fasterxml.jackson.core.JsonProcessingException;
|
|
27 | 28 | import it.gov.pagopa.paymentupdater.model.Payment;
|
28 | 29 | import it.gov.pagopa.paymentupdater.producer.PaymentProducer;
|
29 | 30 | import it.gov.pagopa.paymentupdater.repository.PaymentRepository;
|
30 |
| -import it.gov.pagopa.paymentupdater.restclient.proxy.ApiClient; |
31 | 31 | import it.gov.pagopa.paymentupdater.restclient.proxy.api.DefaultApi;
|
32 | 32 | import it.gov.pagopa.paymentupdater.restclient.proxy.model.PaymentRequestsGetResponse;
|
33 |
| -import it.gov.pagopa.paymentupdater.util.Constants; |
34 | 33 | import it.gov.pagopa.paymentupdater.util.PaymentUtil;
|
35 | 34 | import lombok.extern.slf4j.Slf4j;
|
36 | 35 |
|
@@ -80,7 +79,7 @@ public ProxyResponse checkPayment(Payment payment)
|
80 | 79 | LocalDate dueDate = PaymentUtil.getLocalDateFromString(resp.getDueDate());
|
81 | 80 | proxyResp.setDueDate(dueDate);
|
82 | 81 | return proxyResp;
|
83 |
| - } catch (HttpClientErrorException errorException) { |
| 82 | + } catch (HttpStatusCodeException errorException) { |
84 | 83 | // manage 4XX errors
|
85 | 84 | ProxyPaymentResponse res = mapper.readValue(errorException.getResponseBodyAsString(),
|
86 | 85 | ProxyPaymentResponse.class);
|
@@ -115,9 +114,6 @@ public ProxyResponse checkPayment(Payment payment)
|
115 | 114 | } else {
|
116 | 115 | throw errorException;
|
117 | 116 | }
|
118 |
| - } catch (HttpServerErrorException errorException) { |
119 |
| - // manage 5XX errors |
120 |
| - throw errorException; |
121 | 117 | }
|
122 | 118 | }
|
123 | 119 |
|
|
0 commit comments