# CellError Class

# Constructors

# constructor

+ new CellError(type: ErrorType, message?: undefined | string, root?: FormulaVertex, originFunction?: undefined | string, argumentIndex?: undefined | number, propagated: boolean, originAddress?: SimpleCellAddress, originAddressVersion?: undefined | number): CellError

Defined in src/Cell.ts:149 (opens new window)

Parameters:

Name Type Default
type ErrorType -
message? undefined | string -
root? FormulaVertex -
originFunction? undefined | string -
argumentIndex? undefined | number -
propagated boolean false
originAddress? SimpleCellAddress -
originAddressVersion? undefined | number -

Returns: CellError

# Properties

# argumentIndex OptionalReadonly

argumentIndex? : undefined | number

Defined in src/Cell.ts:155 (opens new window)


# message OptionalReadonly

message? : undefined | string

Defined in src/Cell.ts:152 (opens new window)


# originAddress OptionalReadonly

originAddress? : SimpleCellAddress

Defined in src/Cell.ts:157 (opens new window)


# originAddressVersion OptionalReadonly

originAddressVersion? : undefined | number

Defined in src/Cell.ts:158 (opens new window)


# originFunction OptionalReadonly

originFunction? : undefined | string

Defined in src/Cell.ts:154 (opens new window)


# propagated Readonly

propagated: boolean

Defined in src/Cell.ts:156 (opens new window)


# root OptionalReadonly

root? : FormulaVertex

Defined in src/Cell.ts:153 (opens new window)


# type Readonly

type: ErrorType

Defined in src/Cell.ts:151 (opens new window)

# Methods

# asPropagated

asPropagated(): CellError

Defined in src/Cell.ts:198 (opens new window)

Marks this error as read from another cell rather than produced by the current evaluation.

This is what stops a cell from adopting an error it only read: attachRootVertex skips a propagated error, so the reported address stays the one where the error actually appeared.

Returns: CellError


# attachRootVertex

attachRootVertex(vertex: FormulaVertex): CellError

Defined in src/Cell.ts:235 (opens new window)

Parameters:

Name Type
vertex FormulaVertex

Returns: CellError


# withArgumentIndex

withArgumentIndex(index: number): CellError

Defined in src/Cell.ts:185 (opens new window)

Records which argument of the origin function was rejected. First occurrence wins, and a propagated error never acquires one: the reading function's own argument slot is not the offending argument.

Parameters:

Name Type Description
index number zero-based index of the offending argument

Returns: CellError


# withOrigin

withOrigin(functionName: string): CellError

Defined in src/Cell.ts:171 (opens new window)

Names the function or operator that produced this error.

First occurrence wins, so an outer function that merely received the error back does not claim it: =SUM(SQRT(-1)) keeps SQRT. A propagated error — one read out of another cell rather than produced here — can never acquire an origin it did not already have.

Parameters:

Name Type Description
functionName string the function or operator helper that produced the error

Returns: CellError


# withOriginAddress

withOriginAddress(address: SimpleCellAddress, version: number): CellError

Defined in src/Cell.ts:220 (opens new window)

Records the address an otherwise rootless error appeared at, and the moment it was recorded.

For vertices that hold a static error rather than computing one (a parse error, or an error value the user typed), there is no FormulaVertex to serve as a lazily-resolved root, so the address has to be recorded on the value itself. A recorded address is a snapshot and does go stale: the cell that read it caches this instance, and a later row or column change that merely shifts that cell does not recompute it. The version is what makes the snapshot repairable — it names the point in LazilyTransformingAstService's history the address was true at, so Exporter can replay the intervening transformations over it and report where the origin sits now. See LazilyTransformingAstService.applyTransformationsToAddress.

Parameters:

Name Type Description
address SimpleCellAddress the address the error was read from
version number the transformation version that address was current at

Returns: CellError


# parsingError Static

parsingError(detailedMessage?: undefined | string): CellError

Defined in src/Cell.ts:231 (opens new window)

Returns a CellError with a given message.

Parameters:

Name Type Description
detailedMessage? undefined | string message to be displayed

Returns: CellError