Skip to content

Commit

Permalink
feat(swaps): log full SwapFailureReason name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sangaman committed Apr 22, 2020
1 parent 3144c4e commit 0a93f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/swaps/Swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 0a93f96

Please sign in to comment.