LSEG Data Library for TypeScript

onError

Attaches an event handler function to the stream, which will be called when an error message is received for some of the requested instruments.

Syntax

stream.onError(callback: RDPStreamErrorCb)

Parameters

Value Description Data type Optional Default value
callback RDPStreamErrorCb function (see RDPStream.Event). function No -

Returned value

The current RDPStream object.

Usage

The following example demonstrates how to display messages received when a data retrieval error happens.

const stream = Delivery.RDPStream.Definition({
    universe: 'R.BP.L',
    parameters: { universeType: 'Symbol' },
}).getStream();

await stream
    .onError((error, stream) => console.log(error, stream))
    .open();
61 words (0:19 mins)