add debug infos to two exception

This commit is contained in:
Emmanuel Viennet 2023-05-30 22:23:19 +02:00
parent 79d92dc9ac
commit 9a4f7abfa8
2 changed files with 8 additions and 2 deletions

View File

@ -70,7 +70,7 @@ from app.comp import res_sem
from app.comp.res_compat import NotesTableCompat
from app.models import Departement, FormSemestre
from app.scodoc.TrivialFormulator import TrivialFormulator
from app.scodoc.sco_exceptions import ScoPermissionDenied
from app.scodoc.sco_exceptions import ScoException, ScoPermissionDenied
from app.scodoc import html_sco_header
from app.scodoc import sco_bulletins_pdf
from app.scodoc import sco_groups
@ -125,6 +125,12 @@ class BaseArchiver(object):
if not os.path.isdir(obj_dir):
log(f"creating directory {obj_dir}")
os.mkdir(obj_dir)
except FileExistsError as exc:
raise ScoException(
f"""BaseArchiver error: obj_dir={obj_dir} exists={
os.path.exists(obj_dir)
} isdir={os.path.isdir(obj_dir)}"""
) from exc
finally:
scu.GSL.release()
return obj_dir

View File

@ -584,7 +584,7 @@ def notes_add(
evaluation_id=evaluation_id, etudid=etudid
).first()
raise ScoBugCatcher(
f"dup: existing={existing_note}"
f"dup: existing={existing_note} value={value}"
) from exc
changed = True
else: