code: def test_suppress_function(caplog):
      @return_on_error("error")
      def fn(value: str, exc: Exception | None = None) -> str:
          if exc:
              raise exc
          return value
  
      caplog.set_level(
          "DEBUG", "airflow.providers.amazon.aws.utils.suppress"
      )
      caplog.clear()
  
      assert fn("no-error") == "no-error"
      assert not caplog.messages
  
      assert fn("foo", ValueError("boooo")) == "error"
      assert (
          "Encountered error during execution function/method 'fn'"
          in caplog.messages
      )
  
      caplog.clear()
      with pytest.raises(SystemExit, match="42"):
          # We do not plan to catch exception which only based on `BaseExceptions`
          fn("bar", SystemExit(42))
      assert not caplog.messages
  
      # We catch even serious exceptions, e.g. we do not provide mandatory argument here
      assert fn() == "error"
      assert (
          "Encountered error during execution function/method 'fn'"
          in caplog.messages
      )
  
imports: from __future__ import annotations
  import pytest
  from airflow.providers.amazon.aws.utils.suppress import return_on_error
label_desc: Use image node_id 1 for calling a global function with example usage: test_suppress_function(caplog) and returns: value