Error Handling

SDK exception handling strategy can be configured via the SDK configuration (via configuration file or via ConfigurationBuilder).

By default, any exception thrown during the execution of a publicly available method is thrown by the SDK. When the config option is set to Catch, exceptions are caught by the SDK and null reference returned to the user. For more information see the ExceptionHandlingStrategy enum.

The exception to this rule is methods on the feed object which are called before the feed is opened - most notably the open method in Java and Open in .Net. Those two methods always throw an exception if the connection to the feed cannot be established.

When Returning a list of objects

Another convention used in the SDK is when returning a list of objects.

  • If the ExceptionHandlingStrategy is set to Catch

    • when the exception happens, it will return null

  • if the ExceptionHandlingStrategy is set to Throw

    • when the exception happens, it will throw an exception

Example scenarios when method returns list of objects

  1. asking Schedule for tournament which does not have schedule and

    1. ExceptionHandlingStrategy is set to Catch it will return empty list.

    2. ExceptionHandlingStrategy is set to Catch and during request exception happens. It will return null.

    3. ExceptionHandlingStrategy is set to Throw it will return empty list.

    4. ExceptionHandlingStrategy is set to Throw and during request exception happens. It will throw.

Last updated

Was this helpful?