diff options
author | Michael Valenta | 2004-10-25 18:12:45 +0000 |
---|---|---|
committer | Michael Valenta | 2004-10-25 18:12:45 +0000 |
commit | b6f5085c0e24daa2713ee70b20b28e6badaf1ed3 (patch) | |
tree | 5daca635e57eb70d271ec46aa63e1e901966f9d6 | |
parent | 2af8f048d8f7679b0a0c224f4d99f2f9940ea1b5 (diff) | |
download | eclipse.platform.team-b6f5085c0e24daa2713ee70b20b28e6badaf1ed3.tar.gz eclipse.platform.team-b6f5085c0e24daa2713ee70b20b28e6badaf1ed3.tar.xz eclipse.platform.team-b6f5085c0e24daa2713ee70b20b28e6badaf1ed3.zip |
Bug 37234 [CVS Core] Missing template file is not handled properly
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java index 8d32e67fe..00ee08839 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java @@ -738,15 +738,22 @@ public class Session { // get the file size from the server long size; boolean compressed = false; + String sizeLine = null; try { - String sizeLine = readLine(); + sizeLine = readLine(); if (sizeLine.charAt(0) == 'z') { compressed = true; sizeLine = sizeLine.substring(1); } size = Long.parseLong(sizeLine, 10); } catch (NumberFormatException e) { - throw new CVSException(Policy.bind("Session.badInt"), e); //$NON-NLS-1$ + // In some cases, the server will give us an error line here + if (sizeLine != null && sizeLine.startsWith("E")) { //$NON-NLS-1$ + handleErrorLine(sizeLine.substring(1).trim(), org.eclipse.core.runtime.Status.OK_STATUS); + return; + } else { + throw new CVSException(Policy.bind("Session.badInt"), e); //$NON-NLS-1$ + } } // create an input stream that spans the next 'size' bytes from the connection InputStream in = new SizeConstrainedInputStream(connection.getInputStream(), size, true /*discardOnClose*/); @@ -784,6 +791,15 @@ public class Session { } /** + * Report the given error line to any listeners + * @param line the error line + * @param status the status that indicates any problems encountered parsing the line + */ + public void handleErrorLine(String line, IStatus status) { + ConsoleListeners.getInstance().errorLineReceived(this, line, status); + } + + /** * Stores the value of the last Mod-time response encountered. * Valid only for the duration of a single CVS command. */ |