Examples of ApiException


Examples of com.app55.error.ApiException

    return r;
  }

  private ApiException processException(Exception e)
  {
    ApiException apiEx = null;
    if (e instanceof ApiException)
      apiEx = (ApiException) e;
    else
      apiEx = ApiException.createException(e.getMessage(), -1L);
    return apiEx;
View Full Code Here

Examples of com.connectifier.xeroclient.models.ApiException

      }
    }
    service.signRequest(token, request);
    Response response = request.send();
    if (response.getCode() != 200) {
      ApiException exception = null;
      try {
        exception = unmarshallResponse(response, ApiException.class);
      } catch (Exception e) { 
      }
      if (exception == null) {
        throw new XeroApiException(response.getCode());
      } else {
        throw new XeroApiException(response.getCode(), "Error number "
            + exception.getErrorNumber() + ". " + exception.getMessage());       
      }
    }
    return unmarshallResponse(response, ResponseType.class);
  }
View Full Code Here

Examples of com.google.api.ads.adwords.jaxws.v201406.mcm.ApiException

      this.retrieveAccounts(selector, accountList);
    } catch (Exception e) {
      LOGGER.error("Error on managedCustomerService.get(selector), probably an AuthenticationError: "
          + e.getMessage());
      e.printStackTrace();
      throw new ApiException(
          "Error on managedCustomerService.get(selector), probably an AuthenticationError: " + e.getMessage(),
          new com.google.api.ads.adwords.jaxws.v201406.cm.ApiException());
    }
    return accountList;
  }
View Full Code Here

Examples of com.intel.mtwilson.ApiException

    if (exceptionObject.getClass().equals(IOException.class)) {
      return new WLMPortalException("IOEception."+exceptionObject.getMessage(),exceptionObject);
    }
    if (exceptionObject.getClass().equals(ApiException.class)) {
      /* Soni_Begin_17/09/2012_issue_for_consistent_Error_Message  */
      ApiException ae=(ApiException) exceptionObject;
                        // Added the error code to the display of the message
                        return new WLMPortalException(ae.getMessage() + "[" + ae.getErrorCode() + "]");
                        /* Soni_End_17/09/2012_issue_for_consistent_Error_Message  */
      //return new WLMPortalException("ApiException."+exceptionObject.getMessage(),exceptionObject);
    }
    if (exceptionObject.getClass().equals(IllegalArgumentException.class)) {
      return new WLMPortalException("IllegalArgumentException: "+exceptionObject.getMessage(),exceptionObject);
View Full Code Here

Examples of com.simplegeo.client.http.exceptions.APIException

   * @param e
   * @throws APIException
   */
  protected void dealWithAuthorizationException(Exception e) throws APIException {
    e.printStackTrace();
    throw new APIException(SimpleGeoHandler.NOT_AUTHORIZED, e.getMessage());
  }
View Full Code Here

Examples of com.stripe.exception.APIException

    case 401:
      throw new AuthenticationException(error.message);
    case 402:
      throw new CardException(error.message, error.code, error.param, null);
    default:
      throw new APIException(error.message, null);
    }
  }
View Full Code Here

Examples of com.wordnik.client.ApiException

  //error info- code: 400 reason: "Invalid order" model: <none>
  public void placeOrder (Order body) throws ApiException {
    Object postBody = body;
    // verify required params are set
    if(body == null ) {
       throw new ApiException(400, "missing required params");
    }
    // create path and map variables
    String path = "/store/order".replaceAll("\\{format\\}","json");

    // query params
View Full Code Here

Examples of com.wordnik.client.common.ApiException

  }

  public AuthenticationToken authenticate (String username, String password) throws ApiException {
    // verify required params are set
    if(username == null || password == null ) {
       throw new ApiException(400, "missing required params");
    }
    // create path and map variables
    String path = "/account.{format}/authenticate/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));

    // query params
View Full Code Here

Examples of com.wordnik.swagger.runtime.exception.APIException


        //check for app server values
        if(getApiServer() == null || getApiServer().length() == 0) {
          String[] args = {getApiServer()};
          throw new APIException(APIExceptionCodes.API_SERVER_NOT_VALID, args);
        }

        //make the communication
    resourceURL = getApiServer() + resourceURL;
    if(queryParams.keySet().size() > 0){
      int i=0;
      for(String paramName : queryParams.keySet()){
        String symbol = "&";
        if(i==0){
          symbol = "?";
        }
        resourceURL = resourceURL + symbol + paramName + "=" + queryParams.get(paramName);
        i++;
      }
    }
        Map<String, String> headerMap = new HashMap<String, String>();
        if(securityHandler != null){
            securityHandler.populateSecurityInfo(resourceURL, headerMap);
        }
        WebResource aResource = apiClient.resource(resourceURL);


        //set the required HTTP headers
        Builder builder = aResource.type("application/json");
        for(String key : headerMap.keySet()){
            builder.header(key, headerMap.get(key));
        }
        if(headerParams != null){
            for(String key : headerParams.keySet()){
                builder.header(key, headerParams.get(key));
            }
        }

        ClientResponse clientResponse = null;
        if(method.equals(GET)) {
          clientResponse =  builder.get(ClientResponse.class);
        }else if (method.equals(POST)) {
          clientResponse =  builder.post(ClientResponse.class, serialize(postData));
        }else if (method.equals(PUT)) {
          clientResponse =  builder.put(ClientResponse.class, serialize(postData));
        }else if (method.equals(DELETE)) {
          clientResponse =  builder.delete(ClientResponse.class);
        }
       
        //process the response
        if(clientResponse.getClientResponseStatus() == ClientResponse.Status.OK) {
          String response = clientResponse.getEntity(String.class);
      return response;
        }else{
          int responseCode = clientResponse.getClientResponseStatus().getStatusCode() ;
          throw new APIException(responseCode, clientResponse.getEntity(String.class));
        }
  }
View Full Code Here

Examples of com.wordnik.swagger.runtime.exception.APIException

                Object responseObject = mapper.readValue(response, inputClassName);
                return responseObject;
            }
        } catch (IOException ioe) {
          String[] args = new String[]{response, inputClassName.toString()};
            throw new APIException(APIExceptionCodes.ERROR_CONVERTING_JSON_TO_JAVA, args, "Error in coversting response json value to java object : " + ioe.getMessage(), ioe);
        }
  }
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.