Examples of APIerrorMessage


Examples of com.cloudera.api.ApiErrorMessage

  @Test
  public void testApiErrorMessage() throws Exception {
    Throwable cause = new Throwable("'cause.");
    Throwable t = new Throwable("To err is human...", cause);
    checkJsonXML(new ApiErrorMessage(t));
  }
View Full Code Here

Examples of com.geekabyte.jprowork.exceptions.APIerrorMessage

        if (resultMap == null) {
            // TODO standardize all the exception api calls can throw
            //throw new InvalidResponseJsonString();
            return null;
        } else if (resultMap.get("error") != null) {
            throw new APIerrorMessage(resultMap.get("error"));
        } else {
            // create a new Project object and return
            int projectId = Integer.parseInt(resultMap.get("id"));
            newProject = this.getProject(projectId);
            return newProject;
View Full Code Here

Examples of com.geekabyte.jprowork.exceptions.APIerrorMessage

        Map<String, String> resultMap = gson.fromJson(responseJson,
                new TypeToken<Map<String, String>>() {
        }.getType());

        if (resultMap == null) {
            throw new APIerrorMessage("Conversion from Json string returned null");
        } else if (resultMap.get("error") != null) {
            throw new APIerrorMessage(resultMap.get("error"));
        } else {
            // create a new task object and return
            int taskId = Integer.parseInt(resultMap.get("id"));
            Task newTask = this.getTask(taskId);
View Full Code Here

Examples of com.geekabyte.jprowork.exceptions.APIerrorMessage

        Map<String, String> resultMap = gson.fromJson(responseJson,
                new TypeToken<Map<String, String>>() {
        }.getType());

        if (resultMap == null) {
            throw new APIerrorMessage("Conversion from Json string returned null");
        } else if (resultMap.get("error") != null) {
            throw new APIerrorMessage(resultMap.get("error"));
        } else {
            // create a new task object and return
            int taskId = Integer.parseInt(resultMap.get("id"));
            Task newTask = this.getTask(taskId);
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.ApiErrorMessage

      String result = response.readEntity(String.class);
      int errCode = response.getStatus();
      if (!HttpStatus.isSuccess(errCode)) {
         String errMessage = null;
         if (result != null && !result.isEmpty()) {
            ApiErrorMessage apiErrorMessage = ApiUtils.jsonToObject(ApiErrorMessage.class, result);
            errMessage = apiErrorMessage.getStatus() + " " + apiErrorMessage.getMessage();
         } else {
            errMessage = errCode + " " + HttpStatus.getMessage(errCode);
         }
         throw AmbariApiException.RESPONSE_EXCEPTION(errCode, errMessage);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.