From 6d2ad3de0acbcd11ea5075a452b66763c5413275 Mon Sep 17 00:00:00 2001 From: Shunichiro Nomura Date: Sun, 30 Jun 2024 02:09:11 +0900 Subject: [PATCH] Add warning on encapsulation error --- capsula/encapsulator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/capsula/encapsulator.py b/capsula/encapsulator.py index ffe0abff..87375f59 100644 --- a/capsula/encapsulator.py +++ b/capsula/encapsulator.py @@ -2,6 +2,7 @@ import queue import threading +import warnings from collections import OrderedDict from itertools import chain from typing import TYPE_CHECKING, Any, Tuple, Union @@ -92,6 +93,7 @@ def encapsulate(self) -> Capsule: except Exception as e: # noqa: PERF203 if capsule_item.abort_on_error: raise + warnings.warn(f"Error occurred during encapsulation of {key}: {e}. Skipping.", stacklevel=3) fails[key] = ExceptionInfo.from_exception(e) return Capsule(data, fails)