code: def common_error_handler(exception: BaseException) -> flask.Response:
      """Use to capture connexion exceptions and add link to the type field."""
      if isinstance(exception, ProblemException):
          link = EXCEPTIONS_LINK_MAP.get(exception.status)
          if link:
              response = problem(
                  status=exception.status,
                  title=exception.title,
                  detail=exception.detail,
                  type=link,
                  instance=exception.instance,
                  headers=exception.headers,
                  ext=exception.ext,
              )
          else:
              response = problem(
                  status=exception.status,
                  title=exception.title,
                  detail=exception.detail,
                  type=exception.type,
                  instance=exception.instance,
                  headers=exception.headers,
                  ext=exception.ext,
              )
      else:
          if not isinstance(
              exception, werkzeug.exceptions.HTTPException
          ):
              exception = werkzeug.exceptions.InternalServerError()
  
          response = problem(
              title=exception.name,
              detail=exception.description,
              status=exception.code,
          )
  
      return FlaskApi.get_response(response)
  
imports: from __future__ import annotations
  from http import HTTPStatus
  from typing import TYPE_CHECKING, Any
  import werkzeug
  from connexion import FlaskApi, ProblemException, problem
  from airflow.utils.docs import get_docs_url
label_desc: Use image node_id 1 for calling a global function with example usage: common_error_handler(exception) and returns: FlaskApi