public SVNErrorMessage findChildWithErrorCode(SVNErrorCode errorCode) { final Set<SVNErrorMessage> seen = new HashSet<SVNErrorMessage>(); for (SVNErrorMessage errorMessage = this; errorMessage != null; errorMessage = errorMessage.getChildErrorMessage()) { if (seen.contains(errorMessage)) { return null; } if (errorMessage.getErrorCode() == errorCode) { return errorMessage; } seen.add(errorMessage); } return null; }
/** * Sets a child error message for this one. * * @param childMessage a child error message */ public void setChildErrorMessage(SVNErrorMessage childMessage) { SVNErrorMessage parent = this; SVNErrorMessage child = childMessage; while (child != null) { if (this == child) { parent.setChildErrorMessage(null); break; } parent = child; child = child.getChildErrorMessage(); } myChildErrorMessage = childMessage; }
/** * Gets a string representation of the entire stack trace of * error messages (if they were provided) starting with the initial * cause of the error. * * @return a string representing a full list of error messages */ public String getFullMessage() { SVNErrorMessage err = this; StringBuffer buffer = new StringBuffer(); while (err != null) { buffer.append(err.getMessage()); if (err.hasChildErrorMessage()) { buffer.append('\n'); } err = err.getChildErrorMessage(); } return buffer.toString(); }
/** * Gets a string representation of the entire stack trace of * error messages (if they were provided) starting with the initial * cause of the error. * * @return a string representing a full list of error messages */ public String getFullMessage() { SVNErrorMessage err = this; StringBuffer buffer = new StringBuffer(); while (err != null) { buffer.append(err.getMessage()); if (err.hasChildErrorMessage()) { buffer.append('\n'); } err = err.getChildErrorMessage(); } return buffer.toString(); }
private static Throwable findCause(SVNErrorMessage errorMessage, Throwable cause) { if(cause!=null) return cause; // SVNErrorMessage has its own chaining mechanism, so if no 'cause' is given, try to pick up // the nearset exception from there, so that printStackTrace() would print the root cause. for( SVNErrorMessage e = errorMessage; e!=null; e=e.getChildErrorMessage() ) if(e.getCause()!=null) return e.getCause(); return null; }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) { return; } SVNErrorManager.error(error, SVNLogType.WC); } };
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) { return; } SVNErrorManager.error(error, SVNLogType.WC); } };
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) { return; } SVNErrorManager.error(error, SVNLogType.WC); } };
private static DAVException buildErrorChain(SVNErrorMessage err, int statusCode) { DAVException error = new DAVException(err.getMessage(), null, statusCode, err, SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG, DAVElement.SVN_DAV_ERROR_NAMESPACE, err.getErrorCode().getCode(), null); if (err.getChildErrorMessage() != null) { error.setPreviousException(buildErrorChain(err.getChildErrorMessage(), statusCode)); } return error; }
public void writeError(SVNErrorMessage error) throws SVNException { Object[] buffer = new Object[]{"failure"}; write("(w(", buffer); for (; error != null; error = error.getChildErrorMessage()) { String message = error.getMessage() == null ? "" : error.getMessage(); buffer = new Object[]{new Long(error.getErrorCode().getCode()), message, "", new Integer(0)}; write("(nssn)", buffer); } write(")", null); }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); } }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); } }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); } }
public void writeError(SVNErrorMessage error) throws SVNException { Object[] buffer = new Object[]{"failure"}; write("(w(", buffer); for (; error != null; error = error.getChildErrorMessage()) { String message = error.getMessage() == null ? "" : error.getMessage(); buffer = new Object[]{new Long(error.getErrorCode().getCode()), message, "", new Integer(0)}; write("(nssn)", buffer); } write(")", null); }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); }
public void writeError(SVNErrorMessage error) throws SVNException { Object[] buffer = new Object[]{"failure"}; write("(w(", buffer); for (; error != null; error = error.getChildErrorMessage()) { String message = error.getMessage() == null ? "" : error.getMessage(); buffer = new Object[]{new Long(error.getErrorCode().getCode()), message, "", new Integer(0)}; write("(nssn)", buffer); } write(")", null); }
private void export(String url, String destinationDirectory) throws MojoExecutionException { SubversionUtils svn = new SubversionUtils(trunk + tag + url, destinationDirectory); try { svn.export(); } catch (SVNException e) { SVNErrorMessage err = e.getErrorMessage(); /* * Display all tree of error messages. * Utility method SVNErrorMessage.getFullMessage() may be used instead of the loop. */ while (err != null) { getLog() .error(err.getErrorCode().getCode() + " : " + err.getMessage()); err = err.getChildErrorMessage(); } throw new MojoExecutionException(e.getMessage()); } }
private static void handleInconsistentEOL(SVNException svne, Object path) throws SVNException { SVNErrorMessage errorMessage = svne.getErrorMessage(); while (errorMessage != null && errorMessage.getErrorCode() != SVNErrorCode.IO_INCONSISTENT_EOL) { errorMessage = errorMessage.getChildErrorMessage(); } if (errorMessage != null && errorMessage.getErrorCode() == SVNErrorCode.IO_INCONSISTENT_EOL) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "File ''{0}'' has inconsistent newlines", path); SVNErrorManager.error(error, SVNLogType.DEFAULT); } Throwable cause = svne.getCause(); if (cause == null) { return; } if (cause instanceof SVNException) { handleInconsistentEOL((SVNException) cause, path); } else if (cause instanceof IOExceptionWrapper) { IOExceptionWrapper wrapper = (IOExceptionWrapper) cause; handleInconsistentEOL(wrapper.getOriginalException(), path); } } }