From 9b80626c661f7ba7b951aae4daa1c0f88028a3c8 Mon Sep 17 00:00:00 2001 From: 9qeklajc <9qeklajc> Date: Fri, 25 Jul 2025 22:09:23 +0200 Subject: [PATCH 1/2] add more logging --- router/proxy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/router/proxy.py b/router/proxy.py index 0a737697..52fe7f96 100644 --- a/router/proxy.py +++ b/router/proxy.py @@ -274,6 +274,7 @@ async def proxy( try: request_body_dict = json.loads(request_body) except json.JSONDecodeError: + print(f"Error: failed to parse request body '{request_body}'") return Response( content=json.dumps( {"error": {"type": "invalid_request_error", "code": "invalid_json"}} @@ -355,11 +356,13 @@ async def get_bearer_token_key( try: key_expiry_time = int(key_expiry_time) # type: ignore except ValueError: + print("Invalid Key-Expiry-Time: must be a valid Unix timestamp") raise HTTPException( status_code=400, detail="Invalid Key-Expiry-Time: must be a valid Unix timestamp", ) if not refund_address: + print("Error: Refund-LNURL header required when using Key-Expiry-Time") raise HTTPException( status_code=400, detail="Error: Refund-LNURL header required when using Key-Expiry-Time", From 6c4f58d53b50981c36e53c650990c7db217a8eb9 Mon Sep 17 00:00:00 2001 From: 9qeklajc <9qeklajc> Date: Fri, 25 Jul 2025 22:31:14 +0200 Subject: [PATCH 2/2] fmt --- router/proxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/proxy.py b/router/proxy.py index 52fe7f96..6a5c1528 100644 --- a/router/proxy.py +++ b/router/proxy.py @@ -273,8 +273,8 @@ async def proxy( if request_body: try: request_body_dict = json.loads(request_body) - except json.JSONDecodeError: - print(f"Error: failed to parse request body '{request_body}'") + except json.JSONDecodeError as e: + print(f"Error: failed to parse request body '{e}'") return Response( content=json.dumps( {"error": {"type": "invalid_request_error", "code": "invalid_json"}}