PR - Better handling of async_result (payment_done)#4153
Merged
Conversation
Closed
rakanalh
reviewed
May 28, 2019
Contributor
rakanalh
left a comment
There was a problem hiding this comment.
LGTM, will approve once my comment is implemented.
| return api_error( | ||
| errors="Payment couldn't be completed " | ||
| "(insufficient funds, no route to target or target offline).", | ||
| "(insufficient funds, no route to target or target offline). " + result.reason, |
Contributor
There was a problem hiding this comment.
You could change the three lines above to:
return api_error(
errors=f"Payment couldn't be completed because: {result.reason}",
The message before the reason is not necessary anymore because in the places we emit the EventPaymentSentFailed and we provide the reason.
added 2 commits
May 29, 2019 09:09
the raiden_event_handler now returns to the payment rest layer an instance of EventPaymentSentFailed or EventPaymentSentSuccess. Better handling for error situation and allow the failure reason to be provided back to the caller.
Instead use the reason provided with EventPaymentSentFailed
Codecov Report
@@ Coverage Diff @@
## develop #4153 +/- ##
===========================================
+ Coverage 86.75% 86.83% +0.07%
===========================================
Files 102 102
Lines 12935 12936 +1
===========================================
+ Hits 11222 11233 +11
+ Misses 1713 1703 -10
Continue to review full report at Codecov.
|
Contributor
Author
|
@rakanalh made the change. Thanks |
rakanalh
approved these changes
May 29, 2019
Contributor
|
Thanks @offerm! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the raiden_event_handler now returns to the payment rest layer an instance of EventPaymentSentFailed or EventPaymentSentSuccess. Better handling for error situation and allow the failure reason to be provided back to the caller.