معالجة أخطاء الطلبات
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض واجهة برمجة التطبيقات 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"
}
}
في حال إدخال معرّف مجموعة بيانات غير صالح، سيعرض الطلب ما يلي:
{
"error": {
"code": 404,
"message": "Dataset not found",
"status": "NOT_FOUND"
}
}
لمزيد من المعلومات حول الأخطاء وطريقة التعامل معها، يُرجى الاطّلاع على الأخطاء.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Maps Datasets API returns errors with codes, messages, and status information to help you troubleshoot issues.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors include missing or expired authentication credentials (401), missing required parameters (400), and invalid dataset IDs (404).\u003c/p\u003e\n"],["\u003cp\u003eError responses provide details about the cause of the error, such as the missing credential or parameter.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the Google Cloud error documentation for comprehensive information on error handling and troubleshooting.\u003c/p\u003e\n"]]],[],null,["# Handle request errors\n\nThe Maps Datasets API returns error messages as part of the\nresponse. For example, if you omit the OAuth token from the\nrequest or if the token has expired, the request returns: \n\n```json\n{\n \"error\": {\n \"code\": 401,\n \"message\": \"Request is missing required authentication credential.\n Expected OAuth 2 access token, login cookie or other valid authentication credential.\n See https://developers.google.com/identity/sign-in/web/devconsole-project.\",\n \"status\": \"UNAUTHENTICATED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n \"reason\": \"CREDENTIALS_MISSING\",\n \"domain\": \"googleapis.com\",\n \"metadata\": {\n \"method\": \"google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha.ListDatasets\",\n \"service\": \"mapsplatformdatasets.googleapis.com\"\n }\n }\n ]\n }\n}\n```\n\nIf you omit a required body parameter, such as `displayName` when creating a\ndataset, the request returns: \n\n```json\n{\n \"error\": {\n \"code\": 400,\n \"message\": \"display_name: Display name must be provided\",\n \"status\": \"INVALID_ARGUMENT\"\n }\n}\n```\n\nIf you pass an invalid dataset ID, the request returns: \n\n```json\n{\n \"error\": {\n \"code\": 404,\n \"message\": \"Dataset not found\",\n \"status\": \"NOT_FOUND\"\n }\n}\n```\n\nFor more information on errors and error handling, see\n[Errors](https://cloud.google.com/apis/design/errors)."]]