Package iqq.im

Examples of iqq.im.QQException


      }else{
        timeoutMs -= end - start;
        start = System.currentTimeMillis();
      }
    }
    throw new QQException(QQErrorCode.UNKNOWN_ERROR);
  }
View Full Code Here


        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          errorCount = 0;
          // 跳到步骤二
          check(event.getTarget().toString(), checkListener);
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
          QQException ex = (QQException) event.getTarget();
          if (ex.getError() == QQErrorCode.INVALID_LOGIN_AUTH) {
            // 登录失败,QQ消息的POLL同时也失效,这时那边会重新登录
            // 如果已经在登录中,或者已经登录了,就不用再次执行
            LOG.warn("getPT4Auth error!!! wait relogin...", ex);
            QQSession session = getContext().getSession();
            if(session.getState() == QQSession.State.LOGINING
View Full Code Here

           
            // 把邮件标记为已读,需要邮件列表ID
            // mark(false, mailList, null);
          }
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
          QQException ex = (QQException) event.getTarget();
          if (ex.getError() == QQException.QQErrorCode.INVALID_LOGIN_AUTH) {
            // 凭证失效,重新认证
            doPoll();
          } else if (errorCount < QQConstants.MAX_POLL_ERR_CNT) {
            loopPoll(sid, 0);
            errorCount++;
View Full Code Here

    JSONObject json = new JSONObject(response.getResponseString());
    if (json.getInt("retcode") == 0) {
      notifyActionEvent(QQActionEvent.Type.EVT_OK, user);
    }else{
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
          new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString()));
    }
   
   
  }
View Full Code Here

      }
    }
    // 失败后返回路径
    pic.setFileName(file.getPath());
    pic.setSuccess(false);
    notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQErrorCode.UNEXPECTED_RESPONSE));

    LOG.debug("CFace: " + response.getResponseString());
  }
View Full Code Here

      session.setState(QQSession.State.ONLINE);
      session.setIndex(ret.getInt("index"));
      session.setPort(ret.getInt("port"));
      notifyActionEvent(QQActionEvent.Type.EVT_OK, null);
    }else{
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQErrorCode.INVALID_RESPONSE))//TODO ..
    }
  }
View Full Code Here

      session.setCfaceKey(obj.getString("gface_key"));
      session.setCfaceSig(obj.getString("gface_sig"));
      notifyActionEvent(QQActionEvent.Type.EVT_OK, session);
    }else{
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
        new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString()));
    }
  }
View Full Code Here

        onHttpStatusError(response);
      }
    } catch (QQException e) {
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, e);
    } catch (JSONException e) {
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQErrorCode.JSON_ERROR, e));
    } catch (Throwable e){
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQErrorCode.UNKNOWN_ERROR, e));
    }
  }
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public void onHttpError(Throwable t) {
    if(!doRetryIt(getErrorCode(t), t)){
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(getErrorCode(t), t));
    }
  }
View Full Code Here

  @Override
  public QQHttpRequest buildRequest() throws QQException {
    try {
      return onBuildRequest();
    } catch (JSONException e) {
      throw new QQException(QQErrorCode.JSON_ERROR, e);
    } catch (Throwable e){
      throw new QQException(QQErrorCode.UNKNOWN_ERROR, e);
    }
  }
View Full Code Here

TOP

Related Classes of iqq.im.QQException

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.