From 9a4f7abfa8aa7a279bdb6bbb33589fcc6916422a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 30 May 2023 22:23:19 +0200 Subject: [PATCH] add debug infos to two exception --- app/scodoc/sco_archives.py | 8 +++++++- app/scodoc/sco_saisie_notes.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_archives.py b/app/scodoc/sco_archives.py index 17e2fe2a7..5e09bf96c 100644 --- a/app/scodoc/sco_archives.py +++ b/app/scodoc/sco_archives.py @@ -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 diff --git a/app/scodoc/sco_saisie_notes.py b/app/scodoc/sco_saisie_notes.py index f9f39bf32..6c470777e 100644 --- a/app/scodoc/sco_saisie_notes.py +++ b/app/scodoc/sco_saisie_notes.py @@ -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: