From 3b33535a1d7102c7e60e46fc87f9a761176b9df8 Mon Sep 17 00:00:00 2001 From: Daniel McNally Date: Mon, 9 Sep 2019 10:37:07 -0400 Subject: [PATCH] fix: log error message reason correctly (#1209) This is a minor fix for logging the swap failure error message. The logic on whether to log the error message was backwards, logging it only when undefined. --- lib/swaps/Swaps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/swaps/Swaps.ts b/lib/swaps/Swaps.ts index 46efed650..bb75c255d 100644 --- a/lib/swaps/Swaps.ts +++ b/lib/swaps/Swaps.ts @@ -935,9 +935,9 @@ class Swaps extends EventEmitter { } if (errorMessage) { - this.logger.debug(`deal ${deal.rHash} failed due to ${SwapFailureReason[failureReason]}`); - } else { this.logger.debug(`deal ${deal.rHash} failed due to ${SwapFailureReason[failureReason]}: ${errorMessage}`); + } else { + this.logger.debug(`deal ${deal.rHash} failed due to ${SwapFailureReason[failureReason]}`); } switch (failureReason) {