1
0
forked from ScoDoc/ScoDoc

modif exceptions

This commit is contained in:
Emmanuel Viennet 2022-09-13 10:50:13 +02:00
parent f5ee63dd5c
commit 123af7067c
3 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@ class BaseArchiver(object):
log(
f"invalid archive name: {archive_name}, oid={oid}, archive_id={archive_id}"
)
raise ValueError("invalid archive name")
raise ScoValueError(f"Archive {archive_name} introuvable")
return archive_id
def get_archive_description(self, archive_id):

View File

@ -103,7 +103,7 @@ def do_module_create(args) -> int:
if formation.is_apc():
ue = UniteEns.query.get(args["ue_id"])
if int(args.get("semestre_id", 0)) != ue.semestre_idx:
raise ValueError("Formation incompatible: contacter le support ScoDoc")
raise ScoValueError("Formation incompatible: contacter le support ScoDoc")
# create
cnx = ndb.GetDBConnexion()
module_id = _moduleEditor.create(cnx, args)

View File

@ -105,7 +105,7 @@ def get_group(group_id: int) -> dict:
{"group_id": group_id},
)
if not r:
raise ValueError("invalid group_id (%s)" % group_id)
raise ScoValueError(f"Groupe inexistant ! (id {group_id})")
return r[0]