Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/pyloadapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import json
from json import JSONDecodeError
import logging
import traceback
from typing import Any

import aiohttp
Expand Down Expand Up @@ -83,8 +82,7 @@ async def login(self) -> LoginResponse:
data: LoginResponse = await r.json()
except (JSONDecodeError, TypeError, aiohttp.ContentTypeError) as e:
_LOGGER.debug(
"Exception: Cannot parse login response:\n %s",
traceback.format_exc(),
"Exception: Cannot parse login response:\n %s", exc_info=True
)
raise ParserError(
"Login failed during parsing of request response."
Expand All @@ -94,7 +92,7 @@ async def login(self) -> LoginResponse:
raise InvalidAuth
return data
except (TimeoutError, aiohttp.ClientError) as e:
_LOGGER.debug("Exception: Cannot login:\n %s", traceback.format_exc())
_LOGGER.debug("Exception: Cannot login:\n %s", exc_info=True)
raise CannotConnect from e

async def get(
Expand Down Expand Up @@ -155,7 +153,7 @@ async def get(
_LOGGER.debug(
"Exception: Cannot parse response for %s:\n %s",
command,
traceback.format_exc(),
exc_info=True,
)
raise ParserError(
"Get {command} failed during parsing of request response."
Expand All @@ -167,7 +165,7 @@ async def get(
_LOGGER.debug(
"Exception: Cannot execute command %s:\n %s",
command,
traceback.format_exc(),
exc_info=True,
)
raise CannotConnect(
"Executing command {command} failed due to request exception"
Expand Down Expand Up @@ -240,7 +238,7 @@ async def post(
_LOGGER.debug(
"Exception: Cannot parse response for %s:\n %s",
command,
traceback.format_exc(),
exc_info=True,
)
raise ParserError(
f"Get {command} failed during parsing of request response."
Expand All @@ -252,7 +250,7 @@ async def post(
_LOGGER.debug(
"Exception: Cannot execute command %s:\n %s",
command,
traceback.format_exc(),
exc_info=True,
)
raise CannotConnect(
f"Executing command {command} failed due to request exception"
Expand Down