Skip to content

Commit

Permalink
Set e to get exception when not 401 status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sticky12 committed May 18, 2022
1 parent f6f179e commit c7389ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/eloverblik/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,12 @@ def update(self):
if he.response.status_code == 401:
message = f"Unauthorized error while accessing eloverblik.dk. Wrong or expired refresh token?"
else:
e = sys.exc_info()[1]
message = f"Exception: {e}"

_LOGGER.warn(message)
except:
e = sys.exc_info()[0]
e = sys.exc_info()[1]
_LOGGER.warn(f"Exception: {e}")

_LOGGER.debug("Done fetching data from Eloverblik")
Expand Down

0 comments on commit c7389ef

Please sign in to comment.