ExecutionError
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Apps Script API を使用してスクリプト関数を実行しようとしたことで発生するエラーの性質に関する情報を提供するオブジェクト。run
の呼び出しが成功しても、スクリプト関数(または Apps Script 自体)が例外をスローした場合、レスポンスの本文の error
フィールドには Status
オブジェクトが含まれます。Status
オブジェクトの details
フィールドには、この ExecutionError
オブジェクトのいずれか 1 つを含む配列が含まれます。
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. |"]]