गड़बड़ी ठीक करना
इस स्पेसिफ़िकेशन में बताई गई सभी गड़बड़ियों के लिए, 400 Bad Request
स्टेटस कोड का इस्तेमाल करें. दूसरी सभी गड़बड़ियों के लिए, मैन्युफ़ैक्चरर को क्लाइंट गड़बड़ियों के लिए 4XX रेंज और सर्वर की गड़बड़ियों के लिए 5XX रेंज की गड़बड़ियों का इस्तेमाल करना चाहिए. सभी गड़बड़ी वाले मामलों में, रिस्पॉन्स में हमेशा इस फ़ॉर्मैट में JSON बॉडी शामिल होनी चाहिए:
{
"name": "camera.info",
"state": "error",
"error": {
"code": "serverError",
"message": "cannot get camera info."
}
}
name
, camera.info
, camera.state
, camera.checkForUpdates
में से कोई भी हो सकता है
camera.commands.status
, और camera.commandName
.
- 400 स्थिति कोड के लिए
code
इनमें से एक होना चाहिए:unknownCommand
,
cameraInExclusiveUse
, missingParameter
, invalidParameterName
या
invalidParameterValue
.
message
को मैन्युफ़ैक्चरर ने तय किया है. इसे स्थानीय भाषा में नहीं होना चाहिए
दिखाई देगा.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया."],[[["Always use the `400 Bad Request` status code for errors defined in the specification and appropriate 4XX or 5XX codes for other client or server errors, respectively."],["All error responses must include a JSON body with `name`, `state`, and an `error` object containing `code` and `message`."],["The `error.code` field uses predefined values for 400 errors (`unknownCommand`, `cameraInExclusiveUse`, `missingParameter`, `invalidParameterName`, `invalidParameterValue`) while manufacturers define the `error.message`."],["The `name` field identifies the specific request, such as `camera.info` or `camera.commands.status`, associated with the error."]]],["Error responses must include a JSON body with \"name,\" \"state,\" and \"error\" fields. For specified errors, use the `400 Bad Request` status code, otherwise, employ 4XX for client and 5XX for server errors. The \"name\" field can be one of several camera-related identifiers. \"Code\" within the error object must be one of five predefined error codes for 400 responses. The \"message\" field is free-form, manufacturer-defined, and non-localized.\n"]]