> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/uof/sdk/features/error-handling.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportradar.com/uof/sdk/features/error-handling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
