ModelError
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ModelError(
message,level,cells?,type?,origException?):ModelError
Parameters
Section titled “Parameters”message
Section titled “message”string
Level = WARNING
cells?
Section titled “cells?”ConvertibleToVertexIDs = null
indications of cell(s) or defined name(s) associated with the error
string = 'unknown'
error type identifier
origException?
Section titled “origException?”original exception, included for troubleshooting errors whose reason is unknown
null | Error
Returns
Section titled “Returns”ModelError
Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Inherited from
Section titled “Inherited from”Error.cause
level:
Level
message
Section titled “message”message:
string
Inherited from
Section titled “Inherited from”Error.message
name:
string
Inherited from
Section titled “Inherited from”Error.name
origException
Section titled “origException”origException:
null|Error&object=null
stack?
Section titled “stack?”
optionalstack:string
Inherited from
Section titled “Inherited from”Error.stack
type:
string
vertexIds
Section titled “vertexIds”vertexIds:
VertexIdSet<CellVertexId|NameVertexId>
workbook
Section titled “workbook”workbook:
null|Workbook=null
readonlystaticERROR:3
readonlystaticNONE:0
NOTICE
Section titled “NOTICE”
readonlystaticNOTICE:1
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
UNKNOWN
Section titled “UNKNOWN”
readonlystaticUNKNOWN:-1
WARNING
Section titled “WARNING”
readonlystaticWARNING:2
Accessors
Section titled “Accessors”references
Section titled “references”Get Signature
Section titled “Get Signature”get references():
Set<string>
Returns
Section titled “Returns”Set<string>
set of cell IDs (e.g. Sheet1!A1), defined names, and column names for structured sheets
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON():
object
Produce a representation of this error for JSON serialization.
Adds the non-enumerable properties message and origException (the latter only if set),
and makes cells an array.
Despite the name, this does not return a JSON string, it returns an object to stringify instead of this one, see
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#tojson_behavior
Returns
Section titled “Returns”object
an object that will JSON.stringify more usefully than this instance.
level:
number
message
Section titled “message”message:
string
origException?
Section titled “origException?”
optionalorigException:object
origException.message
Section titled “origException.message”message:
string
origException.stack
Section titled “origException.stack”stack:
undefined|string
type:
string
vertexIds
Section titled “vertexIds”vertexIds:
string[]
toString()
Section titled “toString()”toString():
string
Returns a string representation of an object.
Returns
Section titled “Returns”string
valueOf()
Section titled “valueOf()”valueOf():
string
Returns the primitive value of the specified object.
Returns
Section titled “Returns”string
captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
fromCircularDependencyWith()
Section titled “fromCircularDependencyWith()”
staticfromCircularDependencyWith(vertexIds):ModelError
Create a circular dependency error involving the given cells.
Parameters
Section titled “Parameters”vertexIds
Section titled “vertexIds”ConvertibleToVertexIDs
vertex IDs of cells (defined names or sheet cells) known to be involved in a dependency cycle
Returns
Section titled “Returns”ModelError
fromInvalidCellValueAt()
Section titled “fromInvalidCellValueAt()”
staticfromInvalidCellValueAt(vertexIds):ModelError
Create an error about invalid cell values in workbook input in the given cells.
Parameters
Section titled “Parameters”vertexIds
Section titled “vertexIds”ConvertibleToVertexIDs
vertex IDs of cells (defined names or sheet cells) in which invalid cell values were found and replaced with #VALUE!
Returns
Section titled “Returns”ModelError
fromUnsupported()
Section titled “fromUnsupported()”
staticfromUnsupported(what,neverSupport,cell,isOrAre?,type?):ModelError
Create an error representing something unsupported (a spreadsheet function or other functionality) in a formula
Parameters
Section titled “Parameters”string
the function name or a concise description of the functionality
neverSupport
Section titled “neverSupport”boolean
true if we intend never to support the thing, false if we think we maybe will
the sheet-prefixed cell address or defined name whose formula contains the unsupported thing
CellVertexId | NameVertexId | CellItem
isOrAre?
Section titled “isOrAre?”whichever verb form makes sense after what
"is" | "are"
optional override of the ModelError type; the default type is fn-unsup if
neverSupport is true, else fn
null | string
Returns
Section titled “Returns”ModelError
isError()
Section titled “isError()”
staticisError(error):error is Error
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”Error.isError
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace