Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-03-29 16:46:36 +0000
committerJeff Johnston2018-04-04 16:27:41 +0000
commit5b790412c1af6f890ef147fc6bb0519cfd51889d (patch)
tree78ef97436de30daf3641827de245ba6e1b4205d0 /containers/org.eclipse.linuxtools.docker.core/src/org/eclipse
parent9069bd9714f0cb7c95671121358998ea107be681 (diff)
downloadorg.eclipse.linuxtools-5b790412c1af6f890ef147fc6bb0519cfd51889d.tar.gz
org.eclipse.linuxtools-5b790412c1af6f890ef147fc6bb0519cfd51889d.tar.xz
org.eclipse.linuxtools-5b790412c1af6f890ef147fc6bb0519cfd51889d.zip
Fix DockerException message when message is json format
- the DockerException message looks for a json-ending but there may be a newline or whitespace at the end and so we should just replace the ending sequence with nothing Change-Id: I659a5aa3427f228a2e863207437ca228d736aca2 Reviewed-on: https://git.eclipse.org/r/120455 Tested-by: CI Bot Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'containers/org.eclipse.linuxtools.docker.core/src/org/eclipse')
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java
index 7f4429564d..4b1bd87685 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java
@@ -41,9 +41,7 @@ public class DockerException extends Exception {
// 1.12.0 and beyond.
if (s.startsWith(JSON_MESSAGE_PREFIX)) {
s = s.substring(JSON_MESSAGE_PREFIX.length());
- if (s.endsWith(JSON_MESSAGE_SUFFIX)) {
- s = s.substring(0, s.indexOf(JSON_MESSAGE_SUFFIX));
- }
+ s = s.replaceAll(JSON_MESSAGE_SUFFIX, ""); //$NON-NLS-1$
return s;
}
return super.getMessage();

Back to the top