Skip to content

Commit

Permalink
DMI server manager catch connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed Sep 12, 2023
1 parent ec7020d commit e51a868
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/lib/dmi_service_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ def send_request_and_wait_for_results(self, service_endpoint, data, wait_period=
raise DmiServiceManagerException("dmi_service_manager.local_or_remote setting must be 'local' or 'remote'")

api_endpoint = self.server_address + service_endpoint
resp = requests.post(api_endpoint, json=data, timeout=30)
try:
resp = requests.post(api_endpoint, json=data, timeout=30)
except requests.exceptions.ConnectionError as e :
raise DmiServiceManagerException(f"Unable to connect to DMI Service Manager server: {str(e)}")

if resp.status_code == 202:
# New request successful
results_url = api_endpoint + "?key=" + resp.json()['key']
Expand Down

0 comments on commit e51a868

Please sign in to comment.