Package com.intel.mountwilson.common

Examples of com.intel.mountwilson.common.WLMPortalException


 
  // method to take a common Exception and return specific error based on Exception type.
  public static WLMPortalException handleException(Exception exceptionObject) throws WLMPortalException{
    exceptionObject.printStackTrace();
    if(exceptionObject.getClass().equals(ClientHandlerException.class)){
      return new WLMPortalException("Could not able to Connect to Server. Error Connection Refused.",exceptionObject);
    }
    if (exceptionObject.getClass().equals(JsonParseException.class)) {
      log.error("Error While Parsing Data. "+exceptionObject.getMessage());
      return new WLMPortalException("Error While parsing Data Using Jackson.",exceptionObject);
    }
    if (exceptionObject.getClass().equals(JsonMappingException.class)) {
      log.error("Error While Mapping Data. "+exceptionObject.getMessage());
      return new WLMPortalException("Error While Mapping Data Using Jackson.",exceptionObject);
    }
    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);
    }
   
    return new WLMPortalException("Error Cause, "+exceptionObject.getMessage(),exceptionObject);
  }
View Full Code Here


            try{
              //getting WhitelistService Object from Session, stored while log-in time. 
                service = (WhitelistService)session.getAttribute("apiClientObject");   
            } catch (Exception e) {
        log.error("Error while creating ApiCliennt Object. "+e.getMessage());
        throw new WLMPortalException("Error while creating ApiCliennt Object. "+e.getMessage(),e);
      }
        }
        return service;
    }
View Full Code Here

TOP

Related Classes of com.intel.mountwilson.common.WLMPortalException

Copyright © 2018 www.massapicom. 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.