Currently, the Table Store Python 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 batch_get_row and batch_write_row are successfully called only when the system checks that the status of each row is successful.
The Table Store python SDK has two types of exceptions: OTSClientError and OTSServiceError inherited from Exception.
OTSClientError: Indicates an internal SDK exception, for example, incorrect parameter values or failure to return parsed results.
OTSServiceError: Indicates a server error generated by parsing a server error message. OTSServiceError has the following components:
get_http_status: Returned HTTP code, for example, 200 or 404.
get_error_code: Error type string returned by Table Store.
get_error_message: Error message string returned by Table Store.
get_request_id: UUID that uniquely identifies a request. Send the RequestId to Table Store engineers for help when the problem persists.
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 details, refer to
You can inherit RetryPolicy to customize a retry policy, and pass it in as a parameter when constructing OTSClient object.