From f1219120ea408d3972c4cf7d609ce5b74ad44bd4 Mon Sep 17 00:00:00 2001 From: mmuller Date: Tue, 15 May 2018 13:40:29 -0700 Subject: [PATCH] Revert error message escaping to hand written version It turns out that SourceCodeEscapers has still not been released to github. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=196721579 --- java/google/registry/tools/ShellCommand.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/google/registry/tools/ShellCommand.java b/java/google/registry/tools/ShellCommand.java index f7ae7edd9..a251ac96c 100644 --- a/java/google/registry/tools/ShellCommand.java +++ b/java/google/registry/tools/ShellCommand.java @@ -28,7 +28,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Ascii; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableTable; -import com.google.common.escape.SourceCodeEscapers; import google.registry.util.Clock; import google.registry.util.SystemClock; import java.io.BufferedReader; @@ -260,8 +259,11 @@ public class ShellCommand implements Command { *

Dumps the last line of output prior to doing this. */ private void emitFailure(Throwable e) throws IOException { - System.out.println(FAILURE + e.getClass().getName() + " " - + SourceCodeEscapers.javaCharEscaper().escape(e.getMessage())); + System.out.println( + FAILURE + + e.getClass().getName() + + " " + + e.getMessage().replace("\\", "\\\\").replace("\n", "\\n")); } @VisibleForTesting