Skip to content

Class

+ 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 hyperformula/src/Cell.ts:149

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

OptionalReadonly

• argumentIndex? : undefined | number

Defined in hyperformula/src/Cell.ts:155


OptionalReadonly

• message? : undefined | string

Defined in hyperformula/src/Cell.ts:152


OptionalReadonly

• originAddress? : SimpleCellAddress

Defined in hyperformula/src/Cell.ts:157


OptionalReadonly

• originAddressVersion? : undefined | number

Defined in hyperformula/src/Cell.ts:158


OptionalReadonly

• originFunction? : undefined | string

Defined in hyperformula/src/Cell.ts:154


Readonly

• propagated: boolean

Defined in hyperformula/src/Cell.ts:156


OptionalReadonly

• root? : FormulaVertex

Defined in hyperformula/src/Cell.ts:153


Readonly

• type: ErrorType

Defined in hyperformula/src/Cell.ts:151

▸ asPropagated(): CellError

Defined in hyperformula/src/Cell.ts:198

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(vertex: FormulaVertex): CellError

Defined in hyperformula/src/Cell.ts:235

Parameters:

Name Type
vertex FormulaVertex

Returns: CellError


▸ withArgumentIndex(index: number): CellError

Defined in hyperformula/src/Cell.ts:185

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(functionName: string): CellError

Defined in hyperformula/src/Cell.ts:171

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(address: SimpleCellAddress, version: number): CellError

Defined in hyperformula/src/Cell.ts:220

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


Static

▸ parsingError(detailedMessage?: undefined | string): CellError

Defined in hyperformula/src/Cell.ts:231

Returns a CellError with a given message.

Parameters:

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

Returns: CellError