Processing request execution errors
The error handling strategy of the Universal Tracker SDK aims at:
-
Simplifying the creation of alert messages.
-
Providing sufficient information for debugging.
In order to show a concise, informative alert message, you need to know what causes the error. This is why the messages generated by the .NET framework are grouped according to the request processing flow:
-
ProcessUserRequestException – unable to build an HTTP request from the user’s request.
-
LoadDataFromNetworkException – TCP or HTTP protocol physical connection errors.
-
ParserException – unable to handle server response properly.
The SitecoreUTSdkException class is a common base class of all the exceptions.
The recommended way of handling errors is as follows:
Client application developers can access the original error object in the Exception.InnerException property, and the error stack trace in the Exception.StackTrace property.
To avoid having redundant code, you should catch only the SitecoreUTSdkException exception and handle it in a separate class using the Type.Equals() method.
The Universal Tracker SDK does not provide any error classes that show alerts because they may vary depending on the target platform, and may require customization.