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.
Event
Source Location: packages/core/src/source.ts#L177
Copy1function Throw(error: unknown): Throw
1function Throw(error: unknown): Throw
Copy1unknown
1unknown
The error to be thrown.
Copy1Throw
1Throw
The created Throw event.
Copy1const event = Throw(new Error(...));2console.log(event.type); // `${ThrowType}`.3console.log(event.value); // Error(...).
1const event = Throw(new Error(...));2console.log(event.type); // `${ThrowType}`.3console.log(event.value); // Error(...).
Source Location: packages/core/src/source.ts#L61
Copy1interface Throw {2 readonly error: unknown3 readonly type: ThrowType4}
1interface Throw {2 readonly error: unknown3 readonly type: ThrowType4}
Source Location: packages/core/src/source.ts#L32
Copy1type ThrowType = 1
1type ThrowType = 1
Source Location: packages/core/src/source.ts#L36
Copy1var ThrowType: ThrowType
1var ThrowType: ThrowType