diff --git a/.vscode/settings.json b/.vscode/settings.json index b9d0e79..39a3cb4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -26,5 +26,5 @@ }, "files.insertFinalNewline": true, "git.ignoreLimitWarning": true, - "restructuredtext.confPath": "${workspaceFolder}/docs/source", + "esbonio.sphinx.confDir": "${workspaceFolder}/docs/source", } diff --git a/docs/source/conf.py b/docs/source/conf.py index 929e512..496fdd1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -83,7 +83,7 @@ pygments_style = None # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -# html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/src/cryptocom/exchange/api.py b/src/cryptocom/exchange/api.py index 771d636..edb0a06 100644 --- a/src/cryptocom/exchange/api.py +++ b/src/cryptocom/exchange/api.py @@ -220,22 +220,18 @@ class ApiProvider: f"Error: {resp_json}. " f"Status: {resp.status_code}. Json params: {data}" ) - except httpx.ConnectError: - raise ApiError(f"Cannot connect to host {self.root_url}") - except (asyncio.TimeoutError, httpx.ReadError) as exc: + except ( + asyncio.TimeoutError, + httpx.ReadError, + httpx.ConnectError, + json.JSONDecodeError, + ) as exc: if count == self.retries: raise ApiError( f"Timeout or read error, retries: {self.retries}. " f"Path: {path}. Data: {data}. Exc: {exc}" ) from exc continue - except json.JSONDecodeError: - if resp.status_code == 429: - continue - raise ApiError( - f"Can't decode json, content: {resp.text}. " - f"Code: {resp.status_code}" - ) finally: await client.aclose()