Skip to content

Commit

Permalink
Merge pull request #281 from grafana/fix-exception-handling-on-debug-277
Browse files Browse the repository at this point in the history
Log exception traceback if DEBUG is enabled
  • Loading branch information
mostafa authored Apr 25, 2024
2 parents 11b97be + 7ad9817 commit d2a5ef9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_saml2_auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import (Any, Callable, Dict, Iterable, Mapping, Optional, Tuple,
Union)

from dictor import dictor # type: ignore
from django.conf import settings
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
from django.shortcuts import render
Expand Down Expand Up @@ -152,7 +153,7 @@ def handle_exception(exc: Exception, request: HttpRequest) -> HttpResponse:
HttpResponse: Rendered error page with details
"""
logger = logging.getLogger(__name__)
if getattr(settings.SAML2_AUTH, "DEBUG", False):
if dictor(settings.SAML2_AUTH, "DEBUG", False):
# Log the exception with traceback
logger.exception(exc)
else:
Expand Down

0 comments on commit d2a5ef9

Please sign in to comment.