Skip to content

Commit

Permalink
fixup! do not print stack trace for electrum errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pm47 committed Dec 13, 2023
1 parent 334dcfd commit fdd3bbc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ElectrumClient(
listenJob = listen(socket)
true
} catch (ex: Throwable) {
logger.warning { "electrum connection handshake failed: ${ex?.message}" }
logger.warning { "electrum connection handshake failed: ${ex.message}" }
val ioException = when (ex) {
is TcpSocket.IOException -> ex
else -> TcpSocket.IOException.Unknown(ex.message, ex)
Expand Down Expand Up @@ -111,7 +111,7 @@ class ElectrumClient(
socket
}
} catch (ex: Throwable) {
logger.warning { "could not connect to electrum server: ${ex?.message}" }
logger.warning { "could not connect to electrum server: ${ex.message}" }
val ioException = when (ex) {
is TcpSocket.IOException -> ex
else -> TcpSocket.IOException.ConnectionRefused(ex)
Expand Down Expand Up @@ -160,7 +160,7 @@ class ElectrumClient(
// We use a SupervisorJob to ensure that our CoroutineExceptionHandler is used and exceptions don't propagate
// to our parent scope: we simply disconnect and wait for the application to initiate a reconnection.
val job = scope.launch(CoroutineName("electrum-client") + SupervisorJob() + CoroutineExceptionHandler { _, ex ->
logger.warning { "electrum connection error: ${ex?.message}" }
logger.warning { "electrum connection error: ${ex.message}" }
socket.close()
val ioException = when (ex) {
is TcpSocket.IOException -> ex
Expand Down

0 comments on commit fdd3bbc

Please sign in to comment.