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"}}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-01-14。"],[[["The Maps Datasets API returns errors with codes, messages, and status information to help you troubleshoot issues."],["Common errors include missing or expired authentication credentials (401), missing required parameters (400), and invalid dataset IDs (404)."],["Error responses provide details about the cause of the error, such as the missing credential or parameter."],["Refer to the Google Cloud error documentation for comprehensive information on error handling and troubleshooting."]]],[]]