code: def test_error_handler_no_match(app, client):
      class CustomException(Exception):
          pass
  
      @app.errorhandler(CustomException)
      def custom_exception_handler(e):
          assert isinstance(e, CustomException)
          return "custom"
  
      with pytest.raises(TypeError) as exc_info:
          app.register_error_handler(CustomException(), None)
  
      assert "CustomException() is an instance, not a class." in str(
          exc_info.value
      )
  
      with pytest.raises(ValueError) as exc_info:
          app.register_error_handler(list, None)
  
      assert "'list' is not a subclass of Exception." in str(
          exc_info.value
      )
  
      @app.errorhandler(500)
      def handle_500(e):
          assert isinstance(e, InternalServerError)
  
          if e.original_exception is not None:
              return f"wrapped {type(e.original_exception).__name__}"
  
          return "direct"
  
      with pytest.raises(ValueError) as exc_info:
          app.register_error_handler(999, None)
  
      assert "Use a subclass of HTTPException" in str(exc_info.value)
  
      @app.route("/custom")
      def custom_test():
          raise CustomException()
  
      @app.route("/keyerror")
      def key_error():
          raise KeyError()
  
      @app.route("/abort")
      def do_abort():
          flask.abort(500)
  
      app.testing = False
      assert client.get("/custom").data == b"custom"
      assert client.get("/keyerror").data == b"wrapped KeyError"
      assert client.get("/abort").data == b"direct"
  
file_path: flask/tests/test_user_error_handler.py
imports: import pytest
  from werkzeug.exceptions import Forbidden
  from werkzeug.exceptions import HTTPException
  from werkzeug.exceptions import InternalServerError
  from werkzeug.exceptions import NotFound
  import flask
label_desc: Use image node_id 1 for calling a global function with example usage: test_error_handler_no_match(app, client) and returns: str, str, str, type