Skip to content

Commit

Permalink
fix: log error message reason correctly (#1209)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sangaman authored and michael1011 committed Sep 9, 2019
1 parent 876335e commit 69962db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/swaps/Swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,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) {
Expand Down

0 comments on commit 69962db

Please sign in to comment.