def METHOD_NAME(value, fn, error_message):
  """Return `fn(value)` or raise an EarlyExitError with 400."""
  try:
    return fn(value)
  except (ValueError, TypeError):
    raise EarlyExitError(error_message, 400)