Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respond with 500 if no payment sent #251

Merged
merged 1 commit into from Dec 23, 2022

Conversation

kiwiidb
Copy link
Contributor

@kiwiidb kiwiidb commented Dec 23, 2022

Fixes #250

@kiwiidb kiwiidb requested a review from bumi December 23, 2022 13:21
@kiwiidb kiwiidb merged commit 0564bc0 into main Dec 23, 2022
@kiwiidb kiwiidb deleted the fix/consistent-http-status-keysend branch December 23, 2022 13:21
return c.JSON(http.StatusOK, result)
status := http.StatusOK
if !singleSuccesfulPayment {
status = http.StatusInternalServerError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a correct HTTP status code?
internal server error indicates it's an exception an unexpected bug in our system

payments might fail because the recipient can not receive anything.

maybe a 422 - Unprocessable Entity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would deserve it's own PR as we would need to change it everywhere we're making a payment. I'd rather have it consistent for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we return a 500 if a payment fails? damn, also not a good http cititzen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multikeysend: return error in case no payments completed
2 participants