Skip to content

Commit d3c8f29

Browse files
committed
Fix redundant exception type check
1 parent 2bae886 commit d3c8f29

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/peppol_py/as4_sender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_headers_and_body_for_posting_as4_document(document_content, document_xml
3232
def post_edelivery_as4_document(endpoint_url, body, headers, timeout, user_agent):
3333
try:
3434
r = requests.post(endpoint_url, data=body, headers={"User-Agent": user_agent, **headers}, timeout=timeout)
35-
except (ConnectionError, requests.exceptions.RequestException) as e:
35+
except requests.exceptions.RequestException as e:
3636
raise make_sendpeppol_error(str(e), 'server-error', temporary=True, url=endpoint_url)
3737

3838
try:

src/peppol_py/smp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_service_urls_for_participant_from_smp(participant_id, test_environment,
5757
try:
5858
r = requests.get(smp_url, timeout=timeout, headers={"User-Agent": user_agent})
5959
r.raise_for_status()
60-
except (ConnectionError, requests.exceptions.RequestException) as e:
60+
except requests.exceptions.RequestException as e:
6161
temporary = True
6262
code = 'server-error'
6363
if ((isinstance(e, requests.exceptions.HTTPError) and e.response and e.response.status_code < 500)
@@ -94,7 +94,7 @@ def get_service_info_for_participant_from_smp(participant_id, document_type, tes
9494
try:
9595
r = requests.get(service_url, timeout=timeout, headers={"User-Agent": user_agent})
9696
r.raise_for_status()
97-
except (ConnectionError, requests.exceptions.RequestException) as e:
97+
except requests.exceptions.RequestException as e:
9898
temporary = True
9999
code = 'server-error'
100100
if isinstance(e, requests.exceptions.HTTPError) and e.response and e.response.status_code < 500:
@@ -162,7 +162,7 @@ def validate_peppol_receiver(peppol_recipient, test_environment=True, timeout=20
162162
"""
163163
try:
164164
service_urls = get_service_urls_for_participant_from_smp(peppol_recipient, test_environment, timeout, user_agent)
165-
except (ConnectionError, requests.exceptions.RequestException) as e:
165+
except requests.exceptions.RequestException as e:
166166
if ignore_registry_communication_errors:
167167
return None
168168
else:

0 commit comments

Comments
 (0)