# CellError

## Constructors

### constructor 

\+ **new CellError**(`type`: [ErrorType](hyperformulans.md#static-errortype), `message?`: undefined | string, `root?`: FormulaVertex, `originFunction?`: undefined | string, `argumentIndex?`: undefined | number, `propagated`: boolean, `originAddress?`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:149](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L149)*

**Parameters:**

Name | Type | Default |
------ | ------ | ------ |
`type` | [ErrorType](hyperformulans.md#static-errortype) | - |
`message?` | undefined &#124; string | - |
`root?` | FormulaVertex | - |
`originFunction?` | undefined &#124; string | - |
`argumentIndex?` | undefined &#124; number | - |
`propagated` | boolean | false |
`originAddress?` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | - |

**Returns:** *[CellError](cellerror.md)*

## Properties

### argumentIndex

• **argumentIndex**? : *undefined | number*

*Defined in [src/Cell.ts:155](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L155)*

___

### message

• **message**? : *undefined | string*

*Defined in [src/Cell.ts:152](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L152)*

___

### originAddress

• **originAddress**? : *[SimpleCellAddress](../interfaces/simplecelladdress.md)*

*Defined in [src/Cell.ts:157](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L157)*

___

### originFunction

• **originFunction**? : *undefined | string*

*Defined in [src/Cell.ts:154](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L154)*

___

### propagated

• **propagated**: *boolean*

*Defined in [src/Cell.ts:156](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L156)*

___

### root

• **root**? : *FormulaVertex*

*Defined in [src/Cell.ts:153](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L153)*

___

### type

• **type**: *[ErrorType](hyperformulans.md#static-errortype)*

*Defined in [src/Cell.ts:151](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L151)*

## Methods

### asPropagated 

▸ **asPropagated**(): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:197](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L197)*

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](cellerror.md#attachrootvertex) skips
a propagated error, so the reported address stays the one where the error actually appeared.

**Returns:** *[CellError](cellerror.md)*

___

### attachRootVertex 

▸ **attachRootVertex**(`vertex`: FormulaVertex): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:230](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L230)*

**Parameters:**

Name | Type |
------ | ------ |
`vertex` | FormulaVertex |

**Returns:** *[CellError](cellerror.md)*

___

### withArgumentIndex 

▸ **withArgumentIndex**(`index`: number): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:184](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L184)*

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](cellerror.md)*

___

### withOrigin 

▸ **withOrigin**(`functionName`: string): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:170](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L170)*

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](cellerror.md)*

___

### withOriginAddress 

▸ **withOriginAddress**(`address`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:215](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L215)*

Records the address an otherwise rootless error appeared at.

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`. This
cannot go stale: `CellError` is immutable, so the stored value is never stamped — every read
stamps a fresh copy with the address current at that moment, which is what keeps it correct
across row and column changes.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`address` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | the address the error was read from  |

**Returns:** *[CellError](cellerror.md)*

___

### parsingError

▸ **parsingError**(`detailedMessage?`: undefined | string): *[CellError](cellerror.md)*

*Defined in [src/Cell.ts:226](https://github.com/handsontable/hyperformula/blob/749044d/src/Cell.ts#L226)*

Returns a CellError with a given message.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`detailedMessage?` | undefined &#124; string | message to be displayed  |

**Returns:** *[CellError](cellerror.md)*