Skip to content

Commit

Permalink
fix(VAT ID Check): error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Feb 16, 2024
1 parent 2360b82 commit e6dee20
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ def run_check(doc: VATIDCheck):
requester_country_code=requester_country_code,
requester_vat_number=requester_vat_number
)
except RetryError:
except (RetryError, ConnectionError):
doc.db_set("status", "Service Unavailable", notify=True)
return
except Exception as e:
if e.message.upper() == "INVALID_INPUT":
if hasattr(e, "message") and e.message.upper() == "INVALID_INPUT":
doc.db_set({"status": "Invalid Input", "is_valid": False}, notify=True)
else:
doc.db_set({"status": "Error"}, notify=True)
Expand Down

0 comments on commit e6dee20

Please sign in to comment.