Exception handling
Updated at:2025-10-27
There are two types of billing exception prompts as follows:
| Exception type | Description |
|---|---|
| BceClientException | Client exception |
| BceServerException | Server exception |
Users can use try to obtain the exception generated by a certain event, e.g.:
Plain Text
1 ResourceMonthBillRequest request = new ResourceMonthBillRequest();
2 try {
3 billingClient.getResourceMonthBill(request);
4 } catch (BceServiceException bce){
5 System.out.println(bce.getMessage());
6 } catch (BceClientException bce){
7 System.out.println( bce.getMessage());
8 }
