diff --git a/app/scodoc/gen_tables.py b/app/scodoc/gen_tables.py
index a9ed10aa..2ac3c398 100644
--- a/app/scodoc/gen_tables.py
+++ b/app/scodoc/gen_tables.py
@@ -58,6 +58,7 @@ from app.scodoc import sco_utils as scu
from app.scodoc import sco_excel
from app.scodoc import sco_pdf
from app.scodoc import sco_xml
+from app.scodoc.sco_exceptions import ScoValueError
from app.scodoc.sco_pdf import SU
from app import log
@@ -539,17 +540,18 @@ class GenTable(object):
#
# titles = ["%s" % x for x in self.get_titles_list()]
pdf_style_list = []
- Pt = [
- [Paragraph(SU(str(x)), CellStyle) for x in line]
- for line in (
- self.get_data_list(
- pdf_mode=True,
- pdf_style_list=pdf_style_list,
- with_titles=True,
- omit_hidden_lines=True,
- )
- )
- ]
+ data_list = self.get_data_list(
+ pdf_mode=True,
+ pdf_style_list=pdf_style_list,
+ with_titles=True,
+ omit_hidden_lines=True,
+ )
+ try:
+ Pt = [
+ [Paragraph(SU(str(x)), CellStyle) for x in line] for line in data_list
+ ]
+ except ValueError as exc:
+ raise ScoValueError(f"Erreur dans un format pdf:
{str(exc)}") from exc
pdf_style_list += self.pdf_table_style
T = Table(Pt, repeatRows=1, colWidths=self.pdf_col_widths, style=pdf_style_list)