Status
Status
टाइप, लॉजिकल एरर मॉडल के बारे में बताता है, जो अलग-अलग प्रोग्रामिंग एनवायरमेंट के लिए सही होता है. इनमें REST API और RPC एपीआई शामिल हैं. इसका इस्तेमाल gRPC करता है. हर Status
मैसेज में डेटा के तीन हिस्से होते हैं: गड़बड़ी का कोड, गड़बड़ी का मैसेज, और गड़बड़ी की जानकारी.
आपको एपीआई डिज़ाइन गाइड में, गड़बड़ी वाले इस मॉडल और इसके साथ काम करने के तरीके के बारे में ज़्यादा जानकारी मिल सकती है.
JSON के काेड में दिखाना |
{
"code": integer,
"message": string,
"details": [
{
"@type": string,
field1: ...,
...
}
]
} |
फ़ील्ड |
code |
integer
स्टेटस कोड, जो google.rpc.Code की enum वैल्यू होनी चाहिए.
|
message |
string
डेवलपर को भेजा जाने वाला गड़बड़ी का मैसेज, जो अंग्रेज़ी में होना चाहिए. उपयोगकर्ता को दिखने वाली गड़बड़ी के किसी भी मैसेज को स्थानीय भाषा में लिखा जाना चाहिए और google.rpc.Status.details फ़ील्ड में भेजा जाना चाहिए या क्लाइंट की ओर से स्थानीय भाषा में भेजा जाना चाहिए.
|
details[] |
object
उन मैसेज की सूची जिनमें गड़बड़ी की जानकारी होती है. एपीआई के इस्तेमाल के लिए, मैसेज के टाइप का एक सामान्य सेट मौजूद है. ऐसा ऑब्जेक्ट जिसमें आर्बिट्रेरी टाइप के फ़ील्ड शामिल होते हैं. अतिरिक्त फ़ील्ड "@type" में, टाइप की पहचान करने वाला यूआरआई होता है. उदाहरण: { "id": 1234, "@type": "types.example.com/standard/id" } .
|
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया."],[[["The `Status` type is a structured approach to representing errors in systems like REST APIs and RPC APIs, encompassing an error code, message, and details for comprehensive error handling."],["It's built upon a standard JSON structure with designated fields for 'code', 'message', and 'details', ensuring consistent error reporting across different platforms and programming environments."],["Developers can leverage the accompanying API Design Guide to delve deeper into using the `Status` type effectively and gain practical insights for its implementation."]]],["The `Status` type models errors with three components: `code` (an integer representing the error), `message` (a developer-facing English error description), and `details` (a list of objects providing further error context). `details` contains an array of objects, each with a type identifier. This model is used by gRPC and suitable for REST and RPC APIs. User-facing error messages are recommended to be localized and sent in the details or on the client.\n"]]