Skip to content

ErrorCode

Defined in: src/enums/ErrorCode.ts:5

Enumerates the machine-readable codes carried by a TaskTimerError on its code property, so failures can be branched on without string-matching.

NO_TASK_PROVIDED: "NO_TASK_PROVIDED"

Defined in: src/enums/ErrorCode.ts:9

TaskTimer.add was called without a task, task options or a callback.


TASK_ID_REQUIRED: "TASK_ID_REQUIRED"

Defined in: src/enums/ErrorCode.ts:13

A task was constructed (or reset) without a unique id.


CALLBACK_REQUIRED: "CALLBACK_REQUIRED"

Defined in: src/enums/ErrorCode.ts:17

A task was constructed without a callback function.


DUPLICATE_TASK_ID: "DUPLICATE_TASK_ID"

Defined in: src/enums/ErrorCode.ts:21

A task with the same id already exists on the timer.


NO_SUCH_TASK: "NO_SUCH_TASK"

Defined in: src/enums/ErrorCode.ts:25

TaskTimer.remove was given an id that no task matches.


INVALID_DATE_RANGE: "INVALID_DATE_RANGE"

Defined in: src/enums/ErrorCode.ts:29

A task’s startDate is the same as or after its stopDate.


CANNOT_CHANGE_ID: "CANNOT_CHANGE_ID"

Defined in: src/enums/ErrorCode.ts:33

Task.reset was asked to change the task id, which is immutable.


TASK_ERROR: "TASK_ERROR"

Defined in: src/enums/ErrorCode.ts:39

A task’s callback threw or rejected and the error went unhandled (no taskError listener) while the timer’s silentErrors is false. The original error is on cause.