From 8335ba9388e6603b975b5c1372adb0c3314f81f7 Mon Sep 17 00:00:00 2001 From: ProCode2 Date: Thu, 18 Jan 2024 19:18:17 +0530 Subject: [PATCH] refactor: return error messages properly --- care/abdm/api/viewsets/auth.py | 2 +- care/abdm/api/viewsets/healthid.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/care/abdm/api/viewsets/auth.py b/care/abdm/api/viewsets/auth.py index 79eca67bd0..5802a493db 100644 --- a/care/abdm/api/viewsets/auth.py +++ b/care/abdm/api/viewsets/auth.py @@ -33,7 +33,7 @@ def post(self, request, *args, **kwargs): exc_info=True, ) return Response( - {"error": "Error: Initialising ABDM Gateway failed."}, + {"detail": "Error: Initialising ABDM Gateway failed."}, status=status.HTTP_400_BAD_REQUEST, ) diff --git a/care/abdm/api/viewsets/healthid.py b/care/abdm/api/viewsets/healthid.py index af874da793..318fa7e3b7 100644 --- a/care/abdm/api/viewsets/healthid.py +++ b/care/abdm/api/viewsets/healthid.py @@ -487,7 +487,6 @@ def add_care_context(self, request, *args, **kwargs): return Response( { "detail": "Failed to add care context", - "error": "Error: Failed to integrate care.", }, status=status.HTTP_400_BAD_REQUEST, )