From 0be86014bc5f7573ec50b7efb7f83be108b2e734 Mon Sep 17 00:00:00 2001 From: Spencer Churchill Date: Sun, 28 Apr 2024 19:17:48 -0700 Subject: [PATCH] fixes comment + too general of an exception --- pennylane_ionq/api_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pennylane_ionq/api_client.py b/pennylane_ionq/api_client.py index 1dd913c..0162528 100644 --- a/pennylane_ionq/api_client.py +++ b/pennylane_ionq/api_client.py @@ -133,7 +133,7 @@ def __init__(self, timeout_seconds=600, **kwargs): self.HEADERS = {"User-Agent": self.USER_AGENT} - # Ten minute timeout on requests. + # sets the default timeout for API requests self.TIMEOUT_SECONDS = timeout_seconds if self.AUTHENTICATION_TOKEN: @@ -338,8 +338,8 @@ def handle_error_response(self, response): self.errors.append(error) try: response.raise_for_status() - except Exception as e: - raise Exception(response.text) from e + except requests.exceptions.HTTPError as e: + raise requests.exceptions.HTTPError(e) def refresh_data(self, data, params=None): """