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" } }
如需详细了解错误和错误处理,请参阅 错误。