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.comp.res_compat import NotesTableCompat
from app.models import Departement, FormSemestre from app.models import Departement, FormSemestre
from app.scodoc.TrivialFormulator import TrivialFormulator 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 html_sco_header
from app.scodoc import sco_bulletins_pdf from app.scodoc import sco_bulletins_pdf
from app.scodoc import sco_groups from app.scodoc import sco_groups
@ -125,6 +125,12 @@ class BaseArchiver(object):
if not os.path.isdir(obj_dir): if not os.path.isdir(obj_dir):
log(f"creating directory {obj_dir}") log(f"creating directory {obj_dir}")
os.mkdir(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: finally:
scu.GSL.release() scu.GSL.release()
return obj_dir return obj_dir

View File

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