ChatAppLogEntry
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Gói dữ liệu JSON của thông báo lỗi. Nếu bạn bật Cloud Logging API, các thông báo lỗi này sẽ được ghi vào Google Cloud Logging.
Biểu diễn dưới dạng JSON |
{
"deployment": string,
"error": {
object (Status )
},
"deploymentFunction": string
} |
Trường |
deployment |
string
Quá trình triển khai gây ra lỗi. Đối với các ứng dụng Chat được tạo trong Apps Script, đây là mã triển khai do Apps Script xác định.
|
error |
object (Status )
Mã và thông báo lỗi.
|
deploymentFunction |
string
Tên callback_method chưa mã hoá đang chạy khi gặp lỗi.
|
Trạng thái
Loại Status
xác định một 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. gRPC sử dụng lớp này. 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 và cách xử lý mô hình lỗi này trong Hướng dẫn thiết kế API.
Biểu diễn dưới dạng JSON |
{
"code": integer,
"message": string,
"details": [
{
"@type": string,
field1: ...,
...
}
]
} |
Trường |
code |
integer
Mã trạng thái, phải là 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. Mọi thông báo lỗi hiển thị với người dùng đều phải được bản địa hoá và gửi trong trường google.rpc.Status.details hoặc do ứng dụng bản địa hoá.
|
details[] |
object
Danh sách thông báo chứa thông tin chi tiết về lỗi. Có một bộ các loại thông báo phổ biến để API sử dụng.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eChat app error messages are logged to Google Cloud Logging if the API is enabled, providing details on the deployment, error, and function involved.\u003c/p\u003e\n"],["\u003cp\u003eError messages utilize a standardized \u003ccode\u003eStatus\u003c/code\u003e format, including an error code, message, and optional details for comprehensive debugging.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eStatus\u003c/code\u003e format aligns with gRPC and Google API Design Guide principles for consistent error handling across different programming environments.\u003c/p\u003e\n"]]],["Error messages are logged to Google Cloud Logging when the Cloud Logging API is enabled. Errors are represented in JSON with a deployment string, an error object (containing code, message, and details), and the deployment function name. The `Status` type defines the error model, including an integer `code`, a string `message`, and an array `details` for additional context. The `code` indicates the type of error, while the `message` provides a developer-facing explanation. The details array provides context about the error.\n"],null,["# ChatAppLogEntry\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Status](#Status)\n - [JSON representation](#Status.SCHEMA_REPRESENTATION)\n\nJSON payload of error messages. If the Cloud Logging API is enabled, these error messages are logged to [Google Cloud Logging](https://cloud.google.com/logging/docs).\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"deployment\": string, \"error\": { object (/workspace/chat/api/reference/rest/v1/ChatAppLogEntry#Status) }, \"deploymentFunction\": string } ``` |\n\n| Fields ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `deployment` | `string` The deployment that caused the error. For Chat apps built in Apps Script, this is the deployment ID defined by Apps Script. |\n| `error` | `object (`[Status](/workspace/chat/api/reference/rest/v1/ChatAppLogEntry#Status)`)` The error code and message. |\n| `deploymentFunction` | `string` The unencrypted `callback_method` name that was running when the error was encountered. |\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| JSON representation |\n|------------------------------------------------------------------------------------------------------|\n| ``` { \"code\": integer, \"message\": string, \"details\": [ { \"@type\": string, field1: ..., ... } ] } ``` |\n\n| Fields ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `integer` The status code, which should be an enum value of [google.rpc.Code](/workspace/chat/api/reference/rest/v1/spaces.messages#Message.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](/workspace/chat/api/reference/rest/v1/ChatAppLogEntry#Status.FIELDS.details) field, or localized by the client. |\n| `details[]` | `object` A list of messages that carry the error details. There is a common set of message types for APIs to use. |"]]