Package cn.jpush.api

Examples of cn.jpush.api.BaseResult


          errmsg = ErrorCodeEnum.errorMsg(conn.getResponseCode());
          errmsg = errmsg == null ? conn.getHeaderField(0) : errmsg;
        }else{
          errmsg = conn.getHeaderField(0);
        }
        BaseResult result = new BaseResult(errmsg,conn.getResponseCode());
        return result.toString();
      }

    }
    catch (SocketTimeoutException e) {   
      logger.log(Level.SEVERE,"God! the server throw SocketTimeout Exception." +
          "please check it out the error message:"+e.getMessage());
      BaseResult baseResult = new BaseResult(e.getMessage().toString(),ErrorCodeEnum.CONNECTIONTIMEOUT.value());
      return baseResult.toString();
    }
    catch (ConnectException e) {
      logger.log(Level.SEVERE,"God! the server throw Connect Exception ." +
          "please check it out the error message:"+e.getMessage());
      BaseResult baseResult = new BaseResult(e.getMessage().toString(),ErrorCodeEnum.CONNECTIONREFUSED.value());
      return baseResult.toString();
    }
    catch (UnknownHostException e) {
      logger.log(Level.SEVERE,"God! the server throw UnknownHost Exception ." +
          "please check it out the error message:"+e.getMessage());
      BaseResult baseResult = new BaseResult(e.getMessage().toString(),ErrorCodeEnum.CONNECTIONREFUSED.value());
      return baseResult.toString();
    }
    catch (Exception e) {
      logger.log(Level.SEVERE,"God! the server throw exception." +
          "please check it out the error message:"+e.getMessage());
      BaseResult baseResult = new BaseResult(e.getMessage().toString(),ErrorCodeEnum.UnknownException.value());
      return baseResult.toString();
    }
    finally {   
      if (null != outStream) {
        try {
          outStream.close();
View Full Code Here

TOP

Related Classes of cn.jpush.api.BaseResult

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.