1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

aggiunta generic exception

This commit is contained in:
stefanogoldoni 2021-05-25 01:09:10 +02:00
parent 6c1f907d78
commit 4f7640d0b5

View file

@ -82,6 +82,8 @@ def page_repositories():
evaluation_mode = ConditionMode(request.json['evaluation_mode']) evaluation_mode = ConditionMode(request.json['evaluation_mode'])
except KeyError: except KeyError:
return json_error("Unknown `type` specified.", GENERIC_ENUM_INVALID), 400 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) repository = Repository(name=name, owner_id=user.email, is_active=False, evaluation_mode=evaluation_mode)
ext.session.add(repository) ext.session.add(repository)
ext.session.commit() ext.session.commit()