You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Exception Handling
Exception Handling (Android SDK)
Copy page
Download PDF
Exception Handling (Android SDK)
Requests are sent to the TOS server via the TOS Android SDK interface. The response to each request includes a return code, which identifies the status of the current operation. TOS services comply with the HTTP specification.​
TOS Server-Side Error​
The TOS server adheres to HTTP standards and defines detailed HTTP status codes and business error codes for scenarios involving request failures. For detailed information, please refer to Definition of TOS Server Status Codes and Error Codes.​
SDK Custom Exceptions and Errors​
Catch TosException and retrieve the error code (Code), HTTP status code (StatusCode), and other relevant information. The following is a sample code.​
​
​
try{​
/* your code */​
} catch(TosException e){​
/**​
* ​
**/​
Log.e("TosException", e.getCode()); ​
​
/**​
* ​
**/​
Log.e("TosException", e.getStatusCode()); ​
​
Log.e("TosException", e.toString()); ​
}​
​
​
try{​
/* your code */​
} catch(TosServerException e){​
​
Log.e("TosException", e.getCode()); ​
​
Log.e("TosException", e.getStatusCode()); ​
} catch(TosClientException e){​
Log.e("TosException", e.toString()) ​
} catch(TosException e) {​
Log.e("TosException", e.toString()) ​
}​
​
​
Last updated: 2025.09.25 14:23:26