Fix sentry logs with None (#2738)

* Fix sentry logs with None

* change comment
This commit is contained in:
Pascal Vizeli 2021-03-20 13:17:53 +01:00 committed by GitHub
parent cb3e2dab71
commit 379cef9e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,9 +13,14 @@ class HassioError(Exception):
logger: Optional[Callable[..., None]] = None,
) -> None:
"""Raise & log."""
if logger:
if logger is not None and message is not None:
logger(message)
# Init Base
if message is not None:
super().__init__(message)
else:
super().__init__()
class HassioNotSupportedError(HassioError):