Examples of DiffUploadErrorBean


Examples of com.taobao.eclipse.plugin.reviewboard.core.model.DiffUploadErrorBean

            throw new ReviewboardException(e.getMessage(), e);
        }
    }
   
    public DiffUploadErrorBean getDiffUploadErrorBean(String source) throws ReviewboardException {
        DiffUploadErrorBean diffUploadErrorBean = new DiffUploadErrorBean();
        try {
            JSONObject jsonStat = new JSONObject(source);
            if (jsonStat.getString("stat").equals("fail")) {
                JSONObject jsonError = jsonStat.getJSONObject("err");
                String code = jsonError.getString("code");
                String msg = jsonError.getString("msg");
                if( null == code || code.trim().isEmpty()){
                    throw new IllegalStateException("Upload diff's error code is not 207!");
                }
                diffUploadErrorBean.setCode(code);
                diffUploadErrorBean.setFile(jsonStat.getString("file"));
                diffUploadErrorBean.setMsg(msg);
                diffUploadErrorBean.setRevision(jsonStat.getString("revision"));
            } else {
                throw new IllegalStateException("Request didn't fail!");
            }
        } catch (Exception e) {
            throw new ReviewboardException(e.getMessage(), e);
View Full Code Here

Examples of com.taobao.eclipse.plugin.reviewboard.core.model.DiffUploadErrorBean

            if(!reviewboardReader.getErrorCode(resultContent).equals( UPLOADTOSERVER_FAIL_FILE_CODE )){
                throw new OperationException("Error When Uploading Diff for review_request_id = "+ reviewRequestId
                        +", error information is:" + reviewboardReader.getErrorMessage(resultContent)
                        +",the resultContent from the server is:"+resultContent);
            }else{
                DiffUploadErrorBean diffUploadErrorBean = reviewboardReader.getDiffUploadErrorBean(resultContent);
                StringBuilder errorInfoSB = new StringBuilder();
                errorInfoSB.append("review_request_id = "+ reviewRequestId +"的Request在上传diff时,出现错误,错误原因一般是因为下面之一:");
                errorInfoSB.append(System.getProperty("line.separator"));
                errorInfoSB.append("(1)请仔细检查本地的SVN版本和文件,以及上传时指定的Base Directory");
                errorInfoSB.append(System.getProperty("line.separator"));
                errorInfoSB.append("(2)您不具备该目录的SVN权限;或者您在ReviewBoard服务器尚未配置该目录;");
                errorInfoSB.append(System.getProperty("line.separator"));
                errorInfoSB.append("服务器端返回的错误详情:ReviewBoard服务器找不到SVN文件:"
                        + diffUploadErrorBean.getFile()+",revision="+diffUploadErrorBean.getRevision());
                throw new OperationException(errorInfoSB.toString());
            }
        }
    }
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.