Exception
Last Updated:2020-07-20
Exception Attention
BMR provides two ways of exception attention as follows:
Exceptional Method | Description |
---|---|
BceClientException | Client exception |
BceServerException | Server exception |
Obtain Event Exception
You can use “try” to obtain the event exception, for example:
try {
CreateClusterResponse response = bmrClient.createCluster(
new CreateClusterRequest().withName("java-sdk-test")
.withImageType("hadoop")
.withImageVersion("0.1.0")
.withAutoTerminate(false)
.withLogUri("bos://tester01/sdk/")
.withInstanceGroups(instanceGroups)
.withApplications(applications)
);
} catch (BceServiceException e) {
System.out.println(e.getMessage());
} catch (BceClientException e) {
System.out.println(e.getMessage());
}