LSEG Data Library for .NET

OnError

Optional callback invoked if an error occurs resulting from the request.

Syntax

IPricingStream OnError(Action<string, JObject, IPricingStream> errorCb)

Usage

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

var stream = Pricing.Definition().Universe("EUR=")
                                 .Fields("BID", "ASK", "DSPLY_NAME")
                                 .GetStream();

stream.OnError((item, err, s) => Console.WriteLine($"Error: {err}"))
      .Open() == Stream.State.Opened