百度智能云

All Product Document

          MapReduce

          Exception

          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());
          }
          Previous
          BmrClient
          Next
          Documentation Update Records