Make Tor connect error message more human readable (#4078)

This commit is contained in:
rorp 2022-02-11 10:35:37 -08:00 committed by GitHub
parent 6cfbf67812
commit 1708add6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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) {

View File

@ -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