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

Signature - source.ts#L177

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

Signature - source.ts#L61

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

ThrowType

ThrowType - Type

Signature - source.ts#L32

type ThrowType = 1

ThrowType - Variable

Signature - source.ts#L36

var ThrowType: ThrowType