From 4f7640d0b57f3d81c9c26cf8d4d3b1c49de6a568 Mon Sep 17 00:00:00 2001 From: stefanogoldoni Date: Tue, 25 May 2021 01:09:10 +0200 Subject: [PATCH] aggiunta generic exception --- nest_backend/routes/repository/repositories.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nest_backend/routes/repository/repositories.py b/nest_backend/routes/repository/repositories.py index 57bfcc9..aba4a83 100644 --- a/nest_backend/routes/repository/repositories.py +++ b/nest_backend/routes/repository/repositories.py @@ -82,6 +82,8 @@ def page_repositories(): evaluation_mode = ConditionMode(request.json['evaluation_mode']) except KeyError: return json_error("Unknown `type` specified.", GENERIC_ENUM_INVALID), 400 + except Exception as e: + return json_error("Unknown error: " + str(e)), 400 repository = Repository(name=name, owner_id=user.email, is_active=False, evaluation_mode=evaluation_mode) ext.session.add(repository) ext.session.commit()