Skip to content

Commit

Permalink
fix(VAT ID Check): retry on Connection Error
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Mar 19, 2024
1 parent 0113383 commit 2f1bd97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext_germany/utils/eu_vat.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import re

from requests.exceptions import ConnectionError
from tenacity import (
retry,
retry_any,
retry_if_exception_message,
retry_if_exception_type,
stop_after_attempt,
wait_exponential,
)
Expand Down Expand Up @@ -42,6 +44,7 @@ def check_vat(country_code: str, vat_number: str):
retry_if_exception_message(message="SERVICE_UNAVAILABLE"),
retry_if_exception_message(message="MS_UNAVAILABLE"),
retry_if_exception_message(message="TIMEOUT"),
retry_if_exception_type(ConnectionError),
),
stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=1, min=2, max=64),
Expand Down

0 comments on commit 2f1bd97

Please sign in to comment.