diff options
-rw-r--r-- | slack/error.py | 12 | ||||
-rw-r--r-- | slack/http.py | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/slack/error.py b/slack/error.py index 8a8c1b9..17427f7 100644 --- a/slack/error.py +++ b/slack/error.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Mapping, Union +from typing import TYPE_CHECKING, Dict, Mapping, Union if TYPE_CHECKING: from slack_api.slack_error import SlackErrorResponse @@ -9,9 +9,17 @@ if TYPE_CHECKING: class HttpError(Exception): - def __init__(self, url: str, return_code: int, http_status_code: int, error: str): + def __init__( + self, + url: str, + options: Dict[str, str], + return_code: int, + http_status_code: int, + error: str, + ): super().__init__() self.url = url + self.options = options self.return_code = return_code self.http_status_code = http_status_code self.error = error diff --git a/slack/http.py b/slack/http.py index 820abb8..b899690 100644 --- a/slack/http.py +++ b/slack/http.py @@ -74,7 +74,7 @@ async def http_request( ) await sleep(1000) return await http_request(url, options, timeout, max_retries - 1) - raise HttpError(url, return_code, 0, err) + raise HttpError(url, options, return_code, 0, err) parts = out.split("\r\n\r\nHTTP/") last_header_part, body = parts[-1].split("\r\n\r\n", 1) @@ -94,6 +94,6 @@ async def http_request( return await http_request(url, options, timeout) if http_status >= 400: - raise HttpError(url, return_code, http_status, body) + raise HttpError(url, options, return_code, http_status, body) return body |