ExecutionError
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Un objeto que proporciona información sobre la naturaleza de un error que resulta de un intento de ejecución de una función de secuencia de comandos mediante la API de Apps Script. Si una llamada a run
funciona correctamente, pero la función de secuencia de comandos (o la misma Apps Script) arroja una excepción, el campo error
del cuerpo de la respuesta contendrá un objeto Status
. El campo details
del objeto Status
contiene un array con uno de estos objetos ExecutionError
.
Representación JSON |
{
"scriptStackTraceElements": [
{
object (ScriptStackTraceElement )
}
],
"errorMessage": string,
"errorType": string
} |
Campos |
scriptStackTraceElements[] |
object (ScriptStackTraceElement )
Un array de objetos que proporciona un seguimiento de pila a través de la secuencia de comandos para mostrar dónde falló la ejecución, con la llamada más profunda primero.
|
errorMessage |
string
Es el mensaje de error que arroja Apps Script, generalmente localizado en el idioma del usuario.
|
errorType |
string
El tipo de error, por ejemplo, TypeError o ReferenceError Si el tipo de error no está disponible, este campo no se incluirá.
|
ScriptStackTraceElement
Un seguimiento de pila a través de la secuencia de comandos que muestra dónde falló la ejecución.
Representación JSON |
{
"function": string,
"lineNumber": integer
} |
Campos |
function |
string
El nombre de la función que falló.
|
lineNumber |
integer
El número de línea en el que falló la secuencia de comandos.
|
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[null,null,["Última actualización: 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. |"]]