From c067598cad710c6e10fbe0d75bc29b7f0af883bf Mon Sep 17 00:00:00 2001 From: Nick Ross Date: Thu, 23 Nov 2023 10:17:49 +0000 Subject: [PATCH] fix: use default error url if passed url is None (#2873) --- dataworkspace/proxy.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dataworkspace/proxy.py b/dataworkspace/proxy.py index 116420a304..23e97bfcdf 100644 --- a/dataworkspace/proxy.py +++ b/dataworkspace/proxy.py @@ -446,8 +446,16 @@ async def handle(downstream_request): params = {"message": exception.args[0]} if user_exception else {} status = exception.args[1] if user_exception else 500 - error_url = exception.args[2] if len(exception.args) > 2 else f"/error_{status}" - error_qs = exception.args[3] if len(exception.args) > 3 else {} + error_url = ( + exception.args[2] + if len(exception.args) > 2 and exception.args[2] is not None + else f"/error_{status}" + ) + error_qs = ( + exception.args[3] + if len(exception.args) > 3 and exception.args[3] is not None + else {} + ) return await handle_http( downstream_request, "GET",