Skip to content

Commit

Permalink
Merge pull request #844 from mkmer/add-debug-error-string
Browse files Browse the repository at this point in the history
Additional logging, fix blinksync json
  • Loading branch information
fronzbot authored Jan 5, 2024
2 parents 14c3a4f + a4c57f5 commit 120d6a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions blinkpy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ async def query(
url=url, data=data, headers=headers, timeout=timeout
)
return await self.validate_response(response, json_resp)
except (ClientConnectionError, TimeoutError):
except (ClientConnectionError, TimeoutError) as er:
_LOGGER.error(
"Connection error. Endpoint %s possibly down or throttled.",
"Connection error. Endpoint %s possibly down or throttled. Error: %s",
url,
er,
)
except BlinkBadResponse:
code = None
Expand Down Expand Up @@ -220,8 +221,11 @@ async def send_auth_key(self, blink, key):
if not blink.available:
_LOGGER.error("%s", json_resp["message"])
return False
except (KeyError, TypeError, ContentTypeError):
_LOGGER.error("Did not receive valid response from server.")
except (KeyError, TypeError, ContentTypeError) as er:
_LOGGER.error(
"Did not receive valid response from server. Error: %s",
er,
)
return False
return True

Expand Down
1 change: 1 addition & 0 deletions blinksync/blinksync.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async def main():
working = None
frame = None
await session.close()
await blink.save(f"{path}/blink.json")


# Run the program
Expand Down

0 comments on commit 120d6a2

Please sign in to comment.