ExecutionError

  • Provides information about errors when executing a script function using the Apps Script API.

  • AnExecutionError object is found in thedetails field of aStatus object within the response body'serror field if a script throws an exception.

  • Includes fields likescriptStackTraceElements,errorMessage, anderrorType to detail the error.

  • ScriptStackTraceElement objects within the stack trace provide the function name and line number where the script failed.

An 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 arun call succeeds but the script function (or Apps Script itself) throws an exception, the response body'serror field contains aStatus object. TheStatus object'sdetails field contains an array with a single one of theseExecutionError objects.

JSON representation
{"scriptStackTraceElements":[{object (ScriptStackTraceElement)}],"errorMessage":string,"errorType":string}
Fields
scriptStackTraceElements[]

object (ScriptStackTraceElement)

An array of objects that provide a stack trace through the script to show where the execution failed, with the deepest call first.

errorMessage

string

The error message thrown by Apps Script, usually localized into the user's language.

errorType

string

The error type, for exampleTypeError orReferenceError. If the error type is unavailable, this field is not included.

ScriptStackTraceElement

A stack trace through the script that shows where the execution failed.

JSON representation
{"function":string,"lineNumber":integer}
Fields
function

string

The name of the function that failed.

lineNumber

integer

The line number where the script failed.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.