From e0b77e31734c479b42d0a9c4a16b00e00fed88a2 Mon Sep 17 00:00:00 2001 From: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com> Date: Tue, 6 May 2025 10:27:05 +0200 Subject: [PATCH] chore(HTML): log the stacktrace of errors Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com> --- docling/backend/html_backend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docling/backend/html_backend.py b/docling/backend/html_backend.py index 88a315dd..3ccf10bd 100644 --- a/docling/backend/html_backend.py +++ b/docling/backend/html_backend.py @@ -1,4 +1,5 @@ import logging +import traceback from io import BytesIO from pathlib import Path from typing import Final, Optional, Union, cast @@ -137,7 +138,7 @@ class HTMLDocumentBackend(DeclarativeDocumentBackend): self.analyze_tag(cast(Tag, element), doc) except Exception as exc_child: _log.error( - f"Error processing child from tag {tag.name}: {exc_child!r}" + f"Error processing child from tag {tag.name}:\n{traceback.format_exc()}" ) raise exc_child elif isinstance(element, NavigableString) and not isinstance(