Method

Currently, the Table Store C# SDK adopts the Exception method to handle errors. Operation is successful if the called interface does not throw an exception. If an exception is thrown, operation fails.

Note Batch operation interfaces such as BatchGetRow and BatchWriteRow are successfully called only when the system checks that the status of each row is successful.

Exception

The Table Store C# SDK has two types of exceptions: OTSClientException and OTSServerException inherited from Exception.

  • OTSClientException: indicates an internal SDK exception, for example, incorrect parameter values or failure to return parsed results.

  • OTSServerException: indicates a server error generated by parsing a server error message. OTSServerException has the following components:

    • HttpStatusCode: a returned HTTP code, for example, 200 or 404.

    • ErrorCode: an error type string returned by Table Store.

    • ErrorMessage: an error message string returned by Table Store.

    • RequestId: the UUID that uniquely identifies a request. If a problem persists, save the RequestId and open a ticket.

Retry

The system retries the operation when an error occurs in the SDK. By default, the operation is retried three times at a maximum interval of two seconds. For more information, see the Aliyun.OTS.Retry.DefaultRetryPolicy class.

You can use RetryPolicy in OTSClientConfig to customize a retry policy.