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
This commit is contained in:
mmuller 2018-05-15 13:40:29 -07:00 committed by jianglai
parent 9c0d3b6db3
commit f1219120ea

View file

@ -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 {
* <p>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