요청 오류 처리

Maps Datasets API가 응답의 일부로 오류 메시지를 반환합니다. 예를 들어 요청에서 OAuth 토큰을 생략하거나 토큰이 만료된 경우 요청은 다음을 반환합니다.

{
  "error": {
    "code": 401,
    "message": "Request is missing required authentication credential.
    Expected OAuth 2 access token, login cookie or other valid authentication credential.
    See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "CREDENTIALS_MISSING",
        "domain": "googleapis.com",
        "metadata": {
          "method": "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha.ListDatasets",
          "service": "mapsplatformdatasets.googleapis.com"
        }
      }
    ]
  }
}

데이터 세트를 만들 때 displayName와 같은 필수 본문 매개변수를 생략하면 요청이 다음을 반환합니다.

{
  "error": {
    "code": 400,
    "message": "display_name: Display name must be provided",
    "status": "INVALID_ARGUMENT"
  }
}

잘못된 데이터 세트 ID를 전달하면 요청에서 다음을 반환합니다.

{
  "error": {
    "code": 404,
    "message": "Dataset not found",
    "status": "NOT_FOUND"
  }
}

오류 및 오류 처리에 관한 자세한 내용은 오류를 참고하세요.