Skip to content

Commit

Permalink
Set default values in validate_api_proxy_response to include more d…
Browse files Browse the repository at this point in the history
…etails in error responses to clients

Addresses uncaught exception logged in https://neon-ai.sentry.io/issues/6302853101/events/fefd6b7410644e9bacab910f6349bd00/
  • Loading branch information
NeonDaniel committed Feb 18, 2025
1 parent 322514a commit 21f3959
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions neon_hana/mq_service_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def __init__(self, config: dict):

@staticmethod
def _validate_api_proxy_response(response: dict, query_params: dict):
response.setdefault('content',
{"error": "No response content was received",
"raw_response": response,
"raw_query": query_params})
response.setdefault('status_code', 500)
if response['status_code'] == 200:
try:
resp = json.loads(response['content'])
Expand Down

0 comments on commit 21f3959

Please sign in to comment.