*: don't use exception keyword with structlog
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
a101d48b5a
commit
31ba543c62
|
@ -97,7 +97,7 @@ def before_send(event: dict, hint: dict) -> Optional[dict]:
|
||||||
if "exc_info" in hint:
|
if "exc_info" in hint:
|
||||||
_, exc_value, _ = hint["exc_info"]
|
_, exc_value, _ = hint["exc_info"]
|
||||||
if isinstance(exc_value, ignored_classes):
|
if isinstance(exc_value, ignored_classes):
|
||||||
LOGGER.debug("dropping exception", exception=exc_value)
|
LOGGER.debug("dropping exception", exc=exc_value)
|
||||||
return None
|
return None
|
||||||
if "logger" in event:
|
if "logger" in event:
|
||||||
if event["logger"] in [
|
if event["logger"] in [
|
||||||
|
|
|
@ -69,7 +69,7 @@ def task_error_hook(task_id, exception: Exception, traceback, *args, **kwargs):
|
||||||
"""Create system event for failed task"""
|
"""Create system event for failed task"""
|
||||||
from authentik.events.models import Event, EventAction
|
from authentik.events.models import Event, EventAction
|
||||||
|
|
||||||
LOGGER.warning("Task failure", exception=exception)
|
LOGGER.warning("Task failure", exc=exception)
|
||||||
if before_send({}, {"exc_info": (None, exception, None)}) is not None:
|
if before_send({}, {"exc_info": (None, exception, None)}) is not None:
|
||||||
Event.new(EventAction.SYSTEM_EXCEPTION, message=exception_to_string(exception)).save()
|
Event.new(EventAction.SYSTEM_EXCEPTION, message=exception_to_string(exception)).save()
|
||||||
|
|
||||||
|
|
Reference in New Issue