Python 2.7 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 Python 2.7 應用程式,即使貴機構先前曾使用機構政策重新啟用舊版執行階段的部署作業,也無法部署。現有的 Python 2.7 應用程式在
淘汰日期過後,仍會繼續執行並接收流量。建議您
改用系統支援的最新 Python 版本。
RpcStatus 類別
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
RpcStatus 類別透過下列欄位,提供正在進行的 RPC 或已完成 RPC 的狀態:
state
- RPC 的狀態。
error_name
- 應用程式設定的錯誤名稱。只有在狀態為
APPLICATION_ERROR
時才會設定。應用程式會使用這個欄位傳送錯誤的特定原因。
error_message
- 與 RPC 狀態相關聯的錯誤訊息。
RpcStatus 類別提供 State 子類別,此為可能的 RPC 狀態的 Enum:
OK
- RPC 已順利完成。
RUNNING
- RPC 仍在執行 (未完成)
REQUEST_ERROR
- 要求格式錯誤或不完整。
SERVER_ERROR
- 伺服器發生非預期的錯誤。
NETWORK_ERROR
- 網路發生錯誤。
APPLICATION_ERROR
- 應用程式顯示錯誤。處於此狀態時,RPC 需要自動設定
application_error
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-04 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThe RpcStatus class details the status of an RPC, including its state and any errors.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003estate\u003c/code\u003e field in RpcStatus indicates the current state of the RPC.\u003c/p\u003e\n"],["\u003cp\u003eRpcStatus's \u003ccode\u003eerror_name\u003c/code\u003e and \u003ccode\u003eerror_message\u003c/code\u003e fields convey the specific nature of application errors.\u003c/p\u003e\n"],["\u003cp\u003eThe State Enum within RpcStatus includes states such as \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eRUNNING\u003c/code\u003e, \u003ccode\u003eREQUEST_ERROR\u003c/code\u003e, \u003ccode\u003eSERVER_ERROR\u003c/code\u003e, \u003ccode\u003eNETWORK_ERROR\u003c/code\u003e, and \u003ccode\u003eAPPLICATION_ERROR\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# The RpcStatus Class\n\nThe RpcStatus class provides the status of an on-going or complete RPC via the following fields:\n\n`state`\n: The State of the RPC.\n\n`error_name`\n: The Error name set by the application. Only set when the status is `APPLICATION_ERROR`. Used by the application to transmit the specific reason for an error.\n\n`error_message`\n: The error message associated with the RPC status.\n\nThe RpcStatus class provides a subclass, State, an Enum of possible RPC states:\n\n`OK`\n: The RPC completed successfully.\n\n`RUNNING`\n: The RPC is still running (not complete)\n\n`REQUEST_ERROR`\n: The request was malformed or incomplete.\n\n`SERVER_ERROR`\n: The server experienced an unexpected error.\n\n`NETWORK_ERROR`\n: An error occured in the network.\n\n`APPLICATION_ERROR`\n: The application is indicating an error. When in this state, the RPC needs automatically sets `application_error`."]]