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

API: Send without coins error 500 Internal Server Error #1170

Closed
theborakompanioni opened this issue Feb 8, 2022 · 2 comments · Fixed by #1183
Closed

API: Send without coins error 500 Internal Server Error #1170

theborakompanioni opened this issue Feb 8, 2022 · 2 comments · Fixed by #1183

Comments

@theborakompanioni
Copy link
Contributor

Trying to send a direct payment on a new wallet without coins results in 500 Internal Server Error with content-type text/html rather than application/json.

Request POST taker/direct-send:

{"mixdepth":"0","destination":"bcrt1qrnz0thqslhxu86th069r9j6y7ldkgs2tzgf5wx","amount_sats":"42"}

Response 500 Internal Server Error:

<html><head><title>Processing Failed</title></head><body><b>Processing Failed</b></body></html>

Would it take a lot of effort to change the behavior so that we could return json here?
It be funny to answer with 402 Payment Required (but I assume 409 Conflict is more consistent : D)


On a side note (probably a separate issue, if anything):
When doing the same thing as /coinjoin the server answers with 202 Accepted, start the taker (coinjoin_in_process: true) and will abort the coinjoin 1min later (coinjoin_in_process: false).
This can be seen as "working as expected", but can probably be enhanced by failing earlier.
I do not think it is a high priority as users can recover by just waiting.

@AdamISZ
Copy link
Member

AdamISZ commented Feb 8, 2022

Trying to send a direct payment on a new wallet without coins results in 500 Internal Server Error

Right that needs a fix, will get onto it as soon as I can.

On a side note (probably a separate issue, if anything):

Yes that one was anticipated (I think it's even in the comments somewhere), I agree it's very suboptimal, but less of a priority to change.

@AdamISZ
Copy link
Member

AdamISZ commented Feb 15, 2022

OK, just need to catch NotEnoughFundsException and pass it through as TransactionFailed with the right error message. Will PR shortly (this should get in the release).

takinbo pushed a commit to takinbo/joinmarket-clientserver that referenced this issue May 27, 2022
Fixes JoinMarket-Org#1170.
Prior to this commit, an attempt to spend using
the direct-send endpoint in the RPC API would
cause a backend crash because the NoFundsException
was not being caught.
This is now fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants