Skip to main

Throw

Throw

A Throw event represents the "throwing" of an error, and has an error field equal to the error the event is carrying. After a Sink receives an Error event, it will be disposed and will not take any more events.

See Also

Throw - Function

Source Location: packages/core/src/source.ts#L177

Signature

function Throw(error: unknown): Throw

Parameters

ParameterTypeDescription
error
unknown

The error to be thrown.

Returns

TypeDescription
Throw

The created Throw event.

Example Usage

const event = Throw(new Error(...));
console.log(event.type); // `${ThrowType}`.
console.log(event.value); // Error(...).

Throw - Interface

Source Location: packages/core/src/source.ts#L61

Signature

interface Throw {
readonly error: unknown
readonly type: ThrowType
}

ThrowType

ThrowType - Type

Source Location: packages/core/src/source.ts#L32

Signature

type ThrowType = 1

ThrowType - Variable

Source Location: packages/core/src/source.ts#L36

Signature

var ThrowType: ThrowType