diff --git a/typedflow/typedflow.py b/typedflow/typedflow.py
index 8185bd6..b6dc426 100644
--- a/typedflow/typedflow.py
+++ b/typedflow/typedflow.py
@@ -19,6 +19,10 @@ T = TypeVar('T')  # serializable
 K = TypeVar('K')  # serializable
 
 
+class BatchIsEmpty(Exception):
+    pass
+
+
 @dataclass
 class Batch(Generic[T]):
     batch_id: int
@@ -31,8 +35,18 @@ class Task(Generic[T, K]):
 
     def process(self,
                 batch: Batch[T]) -> Batch[K]:
-        lst: List[K] = [self.func(item) for item in batch.data]
-        return Batch(batch_id=batch.batch_id, data=lst)
+        products: List[K] = []
+        for item in batch.data:
+            try:
+                products.append(self.func(item))
+            except Exception as e:
+                logger.warn(repr(e))
+                continue
+        if len(products) > 0:
+            return Batch[K](batch_id=batch.batch_id,
+                            data=products)
+        else:
+            raise BatchIsEmpty()
 
 
 @dataclass
@@ -97,7 +111,6 @@ class Pipeline:
         for batch in self.loader.load():
             try:
                 product: Batch = _run(batch, self.pipeline)
-            except Exception as e:
-                logger.warn(repr(e))
+            except BatchIsEmpty:
                 continue
             self.dumper.dump(product)

Batch doesn't flow if any items in it has an error
even if the majority isn't troublesome
diff --git a/typedflow/tests/typedflow/test_task.py b/typedflow/tests/typedflow/test_task.py
index 3294062..93e6463 100644
--- a/typedflow/tests/typedflow/test_task.py
+++ b/typedflow/tests/typedflow/test_task.py
@@ -77,7 +77,7 @@ def test_process(pl, capsys):
 def test_except_batch(invalid_pl, capsys):
     invalid_pl.run()
     out, _ = capsys.readouterr()
-    assert out == ''
+    assert out == '15\n12\n'
 
 
 def test_multibatch_process(mutlibatch_pl, capsys):

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc build-essential libomp-dev libopenblas-dev
3.9
requirements.txt requirements_dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
bump2version==1.0.1
dataclasses-json==0.6.7
exceptiongroup==1.2.2
flake8==7.2.0
iniconfig==2.1.0
jedi==0.17.2
marshmallow==3.26.1
mccabe==0.7.0
mypy==1.15.0
mypy-extensions==1.0.0
packaging==24.2
parso==0.7.1
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.1
pytest==8.3.5
pytest-runner==6.0.1
python-jsonrpc-server==0.4.0
python-language-server==0.36.2
tomli==2.2.1
-e git+https://github.com/tarohi24/typedflow.git@885708ac898ab55f2cd467b54695ccf4c468edc8#egg=typedflow
typing-inspect==0.9.0
typing_extensions==4.13.0
ujson==5.10.0

name: typedflow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - bump2version==1.0.1
      - dataclasses-json==0.6.7
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - iniconfig==2.1.0
      - jedi==0.17.2
      - marshmallow==3.26.1
      - mccabe==0.7.0
      - mypy==1.15.0
      - mypy-extensions==1.0.0
      - packaging==24.2
      - parso==0.7.1
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pytest==8.3.5
      - pytest-runner==6.0.1
      - python-jsonrpc-server==0.4.0
      - python-language-server==0.36.2
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - typing-inspect==0.9.0
      - ujson==5.10.0
prefix: /opt/conda/envs/typedflow

typedflow/tests/typedflow/test_task.py::test_except_batch
typedflow/tests/typedflow/test_task.py::test_process typedflow/tests/typedflow/test_task.py::test_multibatch_process typedflow/tests/typedflow/test_task.py::test_multibatch_ids
typedflow/typedflow.py
typedflow/typedflow.py