錯誤處理
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
針對這份規格中定義的所有錯誤,請使用 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
。
code
應為下列其中一個 400 狀態碼:unknownCommand
、
cameraInExclusiveUse
、missingParameter
、invalidParameterName
或
invalidParameterValue
。
- 「
message
」是由製造商定義,因此不應提供本地化版本
撰寫新的電子郵件訊息
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[],["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"]]