Skip to content

Commit

Permalink
Merge pull request #46 from Sticky12/master
Browse files Browse the repository at this point in the history
Set e to get exception when not 401 status code
  • Loading branch information
JonasPed authored May 22, 2022
2 parents f6f179e + c7389ef commit 171319d
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 171319d

Please sign in to comment.