From ce500d3644136ab6383e36716116deae3ff195d9 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:32:27 +0100 Subject: [PATCH] fix(VAT ID Check): error handling --- .../erpnext_germany/doctype/vat_id_check/vat_id_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext_germany/erpnext_germany/doctype/vat_id_check/vat_id_check.py b/erpnext_germany/erpnext_germany/doctype/vat_id_check/vat_id_check.py index 1fb0c52..45a5291 100644 --- a/erpnext_germany/erpnext_germany/doctype/vat_id_check/vat_id_check.py +++ b/erpnext_germany/erpnext_germany/doctype/vat_id_check/vat_id_check.py @@ -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)