docs: def error_handler(f):
      """
      Default error handler.
       - On server side error shows a message
         'An error occurred!' and returns 500 status code.
       - Also serves well in the case when the resource/task/method
         is not found - returns 404 status code.
      """
  
      @wraps(f)
      def error_handling_function(*args, **kwargs):
          @inject(error_config=ErrorConfiguration)
          def get_error_configuration(error_config):
              # type:(ErrorConfiguration)->ErrorConfiguration
              return error_config
  
          def should_skip_handling():
              use_flask_handler = get_error_configuration().use_flask_handler
              is_web_request = isinstance(JobContext.get_current_context(), WebJobContext)
              return use_flask_handler and is_web_request
  
          try:
              return f(*args, **kwargs)
          except Exception as ex:
              if should_skip_handling():
                  raise
  
              for ep in _error_processors:
                  ep.handle(ex)
  
              for eh in _error_handlers:
                  if eh.can_handle(ex):
                      return eh.handle(ex)
  
              return _DEFAULT_ERROR_HANDLER.handle(ex)
  
      return error_handling_function