OSS SDK for Ruby throws exceptions when a request fails. Exception details are logged to oss_sdk.log in the program's running directory. The SDK defines two exception types: ClientError and ServerError. Both are subclasses of RuntimeError.
ClientError
ClientError exceptions are caused by errors inside the SDK — for example, an invalid parameter value or an object being modified during resumable upload or download.
ServerError
ServerError exceptions are caused by server-side errors. Each ServerError contains the following fields parsed from the server's error response:
| Field | Description |
|---|---|
http_code | HTTP status code |
error_code | Error code returned by OSS |
message | OSS error message |
request_id | UUID that uniquely identifies the request. Provide this to OSS technical support when seeking help. |