Exceptions

The SDK comes with a few custom exception classes for better error handling and abstracting certain implementation specific exceptions.

All SDK exceptions should be serializable (they are marked Serializable and override the Serializable constructor). Furthermore, all SDK exceptions implement the three default Exception constructors.

SdkException

The SdkException is the base class for all SDK exceptions and can be useful for catching all SDK related exceptions.

Note that not all exceptions that can be thrown from the SDK are SdkException objects. Exceptions like System.Net.Http.HttpRequestException can also be thrown from the Web SDK. See the API docs for a complete overview.

AuthenticationException

This exception is used for all authentication related errors. Note that this exception can happen at many places in the SDK, and is therefore not listed in the documentation of every method.

ForbiddenException

This exception is used for all authorization related errors. Note that this exception can happen at many places in the SDK, and is therefore not listed in the documentation of every method.

Subclass: PropertyNotFoundException.

InternalException

The InternalException is thrown when problems occur in the SDK and is usually a bug.

NotFoundException

The NotFoundException is thrown when a certain resource is required but cannot be found.

ScriptException

This exception is used for all errors related to script execution (related to the script client).

ValidationException

This exception is used for all validation related errors. This exception is thrown when an object (e.g. an entity) is being persisted but does not pass the validation.

The ValidationException's message can be useful to see why it is thrown, but the ValidationFailure instances on the Failures property list define the specific issues.

Do you have some feedback for us?

If you have suggestions for improving this article,