From 1708add6ecbf451d04ae31ce68c36815c377cbba Mon Sep 17 00:00:00 2001 From: rorp Date: Fri, 11 Feb 2022 10:35:37 -0800 Subject: [PATCH] Make Tor connect error message more human readable (#4078) --- .../src/main/scala/org/bitcoins/server/routes/Server.scala | 2 +- dlc-node/src/main/scala/org/bitcoins/dlc/node/DLCClient.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/server-routes/src/main/scala/org/bitcoins/server/routes/Server.scala b/app/server-routes/src/main/scala/org/bitcoins/server/routes/Server.scala index 39859da9bb..91a3cf817c 100644 --- a/app/server-routes/src/main/scala/org/bitcoins/server/routes/Server.scala +++ b/app/server-routes/src/main/scala/org/bitcoins/server/routes/Server.scala @@ -66,7 +66,7 @@ case class Server( StatusCodes.BadRequest)) case err: Throwable => logger.info(s"Unhandled error in server:", err) - complete(Server.httpError(s"Request failed: ${err.getMessage}")) + complete(Server.httpError(err.getMessage)) } handleRejections(rejectionHandler) { diff --git a/dlc-node/src/main/scala/org/bitcoins/dlc/node/DLCClient.scala b/dlc-node/src/main/scala/org/bitcoins/dlc/node/DLCClient.scala index aa8730e22d..26793082fb 100644 --- a/dlc-node/src/main/scala/org/bitcoins/dlc/node/DLCClient.scala +++ b/dlc-node/src/main/scala/org/bitcoins/dlc/node/DLCClient.scala @@ -79,7 +79,8 @@ class DLCClient( remoteAddress: InetSocketAddress, proxyAddress: InetSocketAddress): Receive = LoggingReceive { case c @ Tcp.CommandFailed(_: Socks5Connect) => - val ex = c.cause.getOrElse(new IOException(s"UnknownError: $c")) + val ex = c.cause.getOrElse(new IOException( + s"Cannot connect to ${remoteAddress.getHostString}:${remoteAddress.getPort} via Tor")) log.error(s"connection failed to $remoteAddress via SOCKS5 $proxyAddress", ex) throw ex