Loại Status xác định mô hình lỗi logic phù hợp với nhiều môi trường lập trình, bao gồm cả API REST và API RPC. Hàm này được gRPC sử dụng. Mỗi thông báo Status chứa 3 phần dữ liệu: mã lỗi, thông báo lỗi và thông tin chi tiết về lỗi.
Bạn có thể tìm hiểu thêm về mô hình lỗi này cũng như cách xử lý trong Hướng dẫn thiết kế API.
Trường
code
int32
Mã trạng thái, phải là một giá trị enum của google.rpc.Code.
message
string
Thông báo lỗi dành cho nhà phát triển, phải bằng tiếng Anh.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-07-30 UTC."],[[["The `Status` type defines a logical error model used by gRPC and REST APIs, containing an error code, message, and details."],["It includes fields for code (`int32`), message (`string`), and details (`Any`), providing comprehensive error information."],["Developers can learn more about this model and its usage in the API Design Guide."]]],[]]