Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
处理请求错误
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Routes Preferred API 会在响应方法调用时返回错误消息。例如,如果您从请求中省略 API 密钥,该方法会返回:
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
如果您省略了必需的正文参数(例如 origin
),该方法会返回:
{
"error": {
"code": 400,
"message": "Origin and destination must be set.",
"status": "INVALID_ARGUMENT"
}
}
如需详细了解错误和错误处理,请参阅错误。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-23。
[[["易于理解","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):2024-11-23。"],[[["The Routes Preferred API utilizes error messages within its responses to indicate issues with method calls."],["These error messages provide specific details, including an error code, a descriptive message, and a status indicator, to help identify the cause of the error."],["Common errors include missing API keys, resulting in a \"PERMISSION_DENIED\" status, or omitting required parameters like \"origin,\" leading to an \"INVALID_ARGUMENT\" status."],["For a comprehensive understanding of errors and their handling within Google Cloud APIs, refer to the provided documentation on Errors."]]],[]]