From 0a93f9696c74c07c969bf71d9834cb1dda7155cb Mon Sep 17 00:00:00 2001 From: Daniel McNally Date: Wed, 22 Apr 2020 13:29:22 -0400 Subject: [PATCH] feat(swaps): log full SwapFailureReason name This writes out the full name of the `SwapFailureReason` to the logs when sending a `SwapFailurePacket` to a peer, like below: `Sending NoRouteFound error to peer: {...` Previously only the numerical enum value was written to the log. Closes #1499. --- lib/swaps/Swaps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/swaps/Swaps.ts b/lib/swaps/Swaps.ts index 672d6159d..aeb20ca0d 100644 --- a/lib/swaps/Swaps.ts +++ b/lib/swaps/Swaps.ts @@ -250,7 +250,7 @@ class Swaps extends EventEmitter { failureReason, errorMessage, }; - this.logger.debug(`Sending swap error to peer: ${JSON.stringify(errorBody)}`); + this.logger.debug(`Sending ${SwapFailureReason[errorBody.failureReason]} error to peer: ${JSON.stringify(errorBody)}`); await peer.sendPacket(new packets.SwapFailedPacket(errorBody, reqId)); }