code: def test_errors():
      with filetexts({".test.foo": b"Jos\xe9\nAlice"}, mode="b"):
          with pytest.raises(UnicodeDecodeError):
              read_text(".test.foo", encoding="ascii").compute()
  
          result = read_text(
              ".test.foo", encoding="ascii", errors="ignore"
          )
          result = result.compute(scheduler="sync")
          assert result == ["Jos\n", "Alice"]
  
file_path: dask/dask/bag/tests/test_text.py
imports: from __future__ import annotations
  from functools import partial
  import pytest
  from fsspec.compression import compr
  from tlz import concat
  from dask import compute, config
  from dask.bag.text import read_text
  from dask.bytes import utils
  from dask.utils import filetexts
label_desc: Use image node_id 4 for calling a global function with example usage: test_errors() without return types