ExecutionError
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ออบเจ็กต์ที่ให้ข้อมูลเกี่ยวกับลักษณะของข้อผิดพลาดที่เกิดจากการพยายามดำเนินการกับฟังก์ชันของสคริปต์โดยใช้ Apps Script API หากการเรียกใช้ run
สำเร็จ แต่ฟังก์ชันของสคริปต์ (หรือ Apps Script เอง) มีการส่งข้อยกเว้น ช่อง error
ของเนื้อหาการตอบกลับจะมีออบเจ็กต์ Status
ช่อง details
ของออบเจ็กต์ Status
มีอาร์เรย์ที่มีออบเจ็กต์ ExecutionError
รายการนี้รายการเดียว
การแสดง JSON |
{
"scriptStackTraceElements": [
{
object (ScriptStackTraceElement )
}
],
"errorMessage": string,
"errorType": string
} |
ช่อง |
scriptStackTraceElements[] |
object (ScriptStackTraceElement )
อาร์เรย์ของออบเจ็กต์ที่มีสแต็กเทรซผ่านสคริปต์เพื่อแสดงตำแหน่งที่การดำเนินการล้มเหลว โดยมีการเรียกใช้ที่ลึกที่สุดก่อน
|
errorMessage |
string
ข้อความแสดงข้อผิดพลาดที่ส่งมาจาก Apps Script ซึ่งมักจะแปลเป็นภาษาของผู้ใช้
|
errorType |
string
ประเภทข้อผิดพลาด เช่น TypeError หรือ ReferenceError หากประเภทข้อผิดพลาดไม่พร้อมใช้งาน ช่องนี้จะไม่รวมไว้
|
ScriptStackTraceElement
สแต็กเทรซผ่านสคริปต์ที่แสดงตำแหน่งที่การดำเนินการล้มเหลว
การแสดง JSON |
{
"function": string,
"lineNumber": integer
} |
ช่อง |
function |
string
ชื่อของฟังก์ชันที่ดำเนินการไม่สำเร็จ
|
lineNumber |
integer
หมายเลขบรรทัดที่สคริปต์ล้มเหลว
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eExecutionError\u003c/code\u003e objects provide information about errors during script execution via the Apps Script API.\u003c/p\u003e\n"],["\u003cp\u003eThese objects contain details such as stack trace elements, error message, and error type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eScriptStackTraceElement\u003c/code\u003e objects offer a stack trace showing the location of the execution failure within the script.\u003c/p\u003e\n"],["\u003cp\u003eThey include the function name and line number where the error occurred.\u003c/p\u003e\n"]]],[],null,["# ExecutionError\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [ScriptStackTraceElement](#ScriptStackTraceElement)\n - [JSON representation](#ScriptStackTraceElement.SCHEMA_REPRESENTATION)\n\nAn object that provides information about the nature of an error resulting from an attempted execution of a script function using the Apps Script API. If a [run](/apps-script/api/reference/rest/v1/scripts/run#google.apps.script.v1.ScriptExecution.Execute) call succeeds but the script function (or Apps Script itself) throws an exception, the response body's [error](/apps-script/api/reference/rest/v1/scripts/run#body.Operation.FIELDS.error) field contains a [Status](/apps-script/api/reference/rest/v1/scripts/run#Status) object. The `Status` object's `details` field contains an array with a single one of these `ExecutionError` objects.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"scriptStackTraceElements\": [ { object (/apps-script/api/reference/rest/v1/ExecutionError#ScriptStackTraceElement) } ], \"errorMessage\": string, \"errorType\": string } ``` |\n\n| Fields ||\n|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `scriptStackTraceElements[]` | `object (`[ScriptStackTraceElement](/apps-script/api/reference/rest/v1/ExecutionError#ScriptStackTraceElement)`)` An array of objects that provide a stack trace through the script to show where the execution failed, with the deepest call first. |\n| `errorMessage` | `string` The error message thrown by Apps Script, usually localized into the user's language. |\n| `errorType` | `string` The error type, for example `TypeError` or `ReferenceError`. If the error type is unavailable, this field is not included. |\n\nScriptStackTraceElement\n-----------------------\n\nA stack trace through the script that shows where the execution failed.\n\n| JSON representation |\n|-------------------------------------------------------|\n| ``` { \"function\": string, \"lineNumber\": integer } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------|\n| `function` | `string` The name of the function that failed. |\n| `lineNumber` | `integer` The line number where the script failed. |"]]