ChatAppLogEntry
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เพย์โหลด JSON ของข้อความแสดงข้อผิดพลาด หากเปิดใช้ Cloud Logging API ระบบจะบันทึกข้อความแสดงข้อผิดพลาดเหล่านี้ไว้ใน Google Cloud Logging
การแสดง JSON |
{
"deployment": string,
"error": {
object (Status )
},
"deploymentFunction": string
} |
ช่อง |
deployment |
string
การติดตั้งใช้งานที่ทำให้เกิดข้อผิดพลาด สําหรับแอป Chat ที่สร้างขึ้นจาก Apps Script รหัสนี้คือรหัสการทําให้ใช้งานได้ที่ Apps Script กําหนด
|
error |
object (Status )
รหัสและข้อความแสดงข้อผิดพลาด
|
deploymentFunction |
string
ชื่อ callback_method ที่ไม่ได้เข้ารหัสซึ่งกำลังทำงานอยู่เมื่อพบข้อผิดพลาด
|
สถานะ
ประเภท Status
จะกำหนดรูปแบบข้อผิดพลาดเชิงตรรกะที่เหมาะสมกับสภาพแวดล้อมการเขียนโปรแกรมต่างๆ ซึ่งรวมถึง REST API และ RPC API gRPC ใช้โปรโตคอลนี้ ข้อความ Status
แต่ละรายการมีข้อมูล 3 รายการ ได้แก่ รหัสข้อผิดพลาด ข้อความแสดงข้อผิดพลาด และรายละเอียดข้อผิดพลาด
ดูข้อมูลเพิ่มเติมเกี่ยวกับรูปแบบข้อผิดพลาดนี้และวิธีจัดการได้ในคู่มือการออกแบบ API
การแสดง JSON |
{
"code": integer,
"message": string,
"details": [
{
"@type": string,
field1: ...,
...
}
]
} |
ช่อง |
code |
integer
รหัสสถานะ ซึ่งควรเป็นค่า enum ของ google.rpc.Code
|
message |
string
ข้อความแสดงข้อผิดพลาดที่แสดงต่อนักพัฒนาแอป ซึ่งควรเป็นภาษาอังกฤษ ข้อความแสดงข้อผิดพลาดที่แสดงต่อผู้ใช้ควรได้รับการแปลและส่งในช่อง google.rpc.Status.details หรือลูกค้าเป็นผู้แปล
|
details[] |
object
รายการข้อความที่มีรายละเอียดข้อผิดพลาด มีชุดประเภทข้อความทั่วไปสำหรับ API ต่างๆ ที่จะใช้ได้
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]