Package google.rpc
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สถานะ
Status
ประเภทจะกำหนดรูปแบบข้อผิดพลาดเชิงตรรกะที่เหมาะกับสภาพแวดล้อมการเขียนโปรแกรมต่างๆ รวมถึง REST API และ RPC API โดย gRPC จะใช้พอร์ตนี้ Status
แต่ละข้อความจะมีข้อมูล 3 ส่วน ได้แก่ รหัสข้อผิดพลาด ข้อความแสดงข้อผิดพลาด และรายละเอียดข้อผิดพลาด
ดูข้อมูลเพิ่มเติมเกี่ยวกับรูปแบบข้อผิดพลาดนี้และวิธีใช้งานได้ในคู่มือการออกแบบ API
ช่อง |
code |
int32
รหัสสถานะซึ่งควรเป็นค่า enum ของ google.rpc.Code
|
message |
string
ข้อความแสดงข้อผิดพลาดที่ส่งถึงนักพัฒนาแอป ซึ่งควรเป็นภาษาอังกฤษ ข้อความแสดงข้อผิดพลาดที่ผู้ใช้เห็นควรได้รับการแปลและส่งในช่อง google.rpc.Status.details หรือแปลโดยไคลเอ็นต์
|
details[] |
Any
รายการข้อความที่มีรายละเอียดข้อผิดพลาด API มีชุดประเภทข้อความที่ใช้กันโดยทั่วไป
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e type defines a logical error model used by gRPC for REST and RPC APIs, containing an error code, message, and details.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eStatus\u003c/code\u003e message includes a status code, a developer-facing error message, and a list of error details carried in messages.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can learn more about this error model in the API Design Guide, and user-facing messages should be localized.\u003c/p\u003e\n"]]],["The `Status` message, used in environments like REST and RPC APIs, defines a logical error model. It conveys errors through three data points: `code` (an integer representing the error type), `message` (a developer-facing English error description), and `details[]` (a list of messages providing further error information). User-facing error messages should be localized and sent in the details field, or localized by the client. This status is used by gRPC.\n"],null,["# Package google.rpc\n\nIndex\n-----\n\n- [Status](/spectrum-access-system/reference/rpc/google.rpc#google.rpc.Status) (message)\n\nStatus\n------\n\nThe `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).\n\n| Fields ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `int32` The status code, which should be an enum value of `google.rpc.Code`. |\n| `message` | `string` A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details](/spectrum-access-system/reference/rpc/google.rpc#google.rpc.Status.FIELDS.repeated.google.protobuf.Any.google.rpc.Status.details) field, or localized by the client. |\n| `details[]` | [Any](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Any) A list of messages that carry the error details. There is a common set of message types for APIs to use. |"]]