From 91a047ba9eb6c10171d1f6f96f4b6840aae511aa Mon Sep 17 00:00:00 2001 From: jrafaelrn Date: Mon, 22 Apr 2024 22:52:52 -0300 Subject: [PATCH] fix insert --- src/functions/bd_transaction/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functions/bd_transaction/main.py b/src/functions/bd_transaction/main.py index 4fc367d..a1fcb4e 100644 --- a/src/functions/bd_transaction/main.py +++ b/src/functions/bd_transaction/main.py @@ -144,15 +144,15 @@ def insert(data): #Transfor to json try: ARRAY_DATA = json.loads(data) + except Exception as e: print(f'Error when parse JSON: {e}') # Se ARRAY_DATA for do tipo 'list', - # Pegar o 1o elemento if type(data) == list: - ARRAY_DATA = data[0] - else: ARRAY_DATA = data + else: + return f'Error when parse JSON: {e}' feedbacks = []