# 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 a 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.&#x20;

{% hint style="danger" %}
An **exception** resulting from method argument validation will always be thrown, disregarding the configured **ExceptionHandlingStrategy**.
{% endhint %}

**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`**&#x20;
  * when the exception happens, it will return null
* if the ExceptionHandlingStrategy is set to **`Throw`**&#x20;
  * when the exception happens, it will throw an exception

**Example scenarios when method returns list of objects**<br>

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.
