Skip to content

Commit

Permalink
Merge pull request #256 from shunichironomura/add-warning-on-error
Browse files Browse the repository at this point in the history
Add warning on encapsulation error
  • Loading branch information
shunichironomura authored Jun 29, 2024
2 parents 4855dac + 6d2ad3d commit 67979e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions capsula/encapsulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 67979e4

Please sign in to comment.