Being C++ class library, the Handler uses exceptions to report about error occurred while performing certain action. For example, the Handler will raise regular exception to report about inability to find actual license for the product. However, Handler processes market data asynchronously, therefore Handler is not able to report about any further errors since market data processing is started. For this reason, the Handler exposes OnixS::SURF::MarketData::ErrorListener
interface and OnixS::SURF::MarketData::Handler::registerErrorListener
member to be able to subscribe to and handle errors.
Once instance of OnixS::SURF::MarketData::ErrorListener
is assigned to the Handler, it will invoke OnixS::SURF::MarketData::ErrorListener::onError
member each time an error occurs. OnixS::SURF::MarketData::ErrorListener::onError
member has several incoming parameters one of which defines human-readable explanation (description) of the error.
Following sample demonstrates how to receive error notifications: