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 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.
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.
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.
InternalException is thrown when problems occur in the SDK and is usually a bug.
NotFoundException is thrown when a certain resource is required but cannot be found.
This exception is used for all errors related to script execution (related to the script client).
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.
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.
Can we improve this article ? Provide feedback