Skip to content

Commit 8fd7d1c

Browse files
authored
fix: Add logging on /token errors
1 parent ef9051a commit 8fd7d1c

File tree

1 file changed

+3
-0
lines changed
  • diracx-routers/src/diracx/routers/auth

1 file changed

+3
-0
lines changed

diracx-routers/src/diracx/routers/auth/token.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import logging
56
import os
67
from typing import Annotated, Literal
78

@@ -31,6 +32,7 @@
3132
from ..fastapi_classes import DiracxRouter
3233

3334
router = DiracxRouter(require_auth=False)
35+
logger = logging.getLogger(__name__)
3436

3537

3638
async def mint_token(
@@ -140,6 +142,7 @@ async def get_oidc_token(
140142
data={"error": "authorization_pending"},
141143
) from e
142144
except ValueError as e:
145+
logger.exception("ValueError in /token")
143146
raise HTTPException(
144147
status_code=status.HTTP_400_BAD_REQUEST,
145148
detail=str(e),

0 commit comments

Comments
 (0)