Author

Topic: Annoying HTTP 500 error (Read 1003 times)

legendary
Activity: 2142
Merit: 1010
Newbie
September 24, 2013, 11:02:27 AM
#10
Guys, the number doesn't matter. I need a description of an error, so I don't need to guess what's happened.
legendary
Activity: 1372
Merit: 1008
1davout
September 24, 2013, 09:55:32 AM
#9
There are several 4xx codes that would fit (beginning with the good old 404) but in any case a 5xx isn't appropriate here, in my opinion.

No, 404 is appropriate if the transaction isn't found, as in it does not exist in the blockchain.

404 means "Not found here" not "Doesn't exist". A given document may exist but can't be found in the local server, thus 404.

In this particular context the transaction exists in the DB, it will be properly returned by a getrawtransaction even if it is not a wallet transaction, 404 is not the best return code for this particular context.

404 might be appropriate if the method was named getwallettransaction, not gettransaction OR if the transaction couldn't be found in the general transactions DB.
legendary
Activity: 1974
Merit: 1029
September 24, 2013, 09:33:04 AM
#8
There are several 4xx codes that would fit (beginning with the good old 404) but in any case a 5xx isn't appropriate here, in my opinion.

No, 404 is appropriate if the transaction isn't found, as in it does not exist in the blockchain.

404 means "Not found here" not "Doesn't exist". A given document may exist but can't be found in the local server, thus 404.
legendary
Activity: 1372
Merit: 1008
1davout
September 24, 2013, 09:13:55 AM
#7
There are several 4xx codes that would fit (beginning with the good old 404) but in any case a 5xx isn't appropriate here, in my opinion.

No, 404 is appropriate if the transaction isn't found, as in it does not exist in the blockchain.
422 means "I understand your request, it is legal, but I can not process it for whatever reason".
500 is definitely wrong though, there is no internal error happening, as in "unexpected error".
member
Activity: 70
Merit: 10
September 24, 2013, 09:12:50 AM
#6
Error 500 = Internal Server Error
legendary
Activity: 1974
Merit: 1029
September 24, 2013, 09:11:53 AM
#5
There are several 4xx codes that would fit (beginning with the good old 404) but in any case a 5xx isn't appropriate here, in my opinion.
legendary
Activity: 1372
Merit: 1008
1davout
September 24, 2013, 05:23:53 AM
#4
What do you expect it to do?

HTTP 422.
legendary
Activity: 2142
Merit: 1010
Newbie
September 24, 2013, 05:20:46 AM
#3
Bitcoind could return "HTTP 200: I don't give info about someone else transactions" at least.
No, it couldn't. HTTP 200 means "Your request is valid and I was able to process it correctly, so here's the data you asked for." HTTP 500 is the correct response when the server is unable to carry out your request. What do you expect it to do? Fail to carry out the request and then not give an error? Roll Eyes

Ok, but it could attach a meaningful description to the 500 response then.
legendary
Activity: 4536
Merit: 3188
Vile Vixen and Miss Bitcointalk 2021-2023
September 24, 2013, 05:05:58 AM
#2
Bitcoind could return "HTTP 200: I don't give info about someone else transactions" at least.
No, it couldn't. HTTP 200 means "Your request is valid and I was able to process it correctly, so here's the data you asked for." HTTP 500 is the correct response when the server is unable to carry out your request. What do you expect it to do? Fail to carry out the request and then not give an error? Roll Eyes
legendary
Activity: 2142
Merit: 1010
Newbie
September 24, 2013, 03:35:09 AM
#1
I noticed bitcoind loves to respond with HTTP 500 error. I use "gettransaction" via JSON-RPC, it works only for transactions in my own wallet. Bitcoind could return "HTTP 200: I don't give info about someone else transactions" at least.

Even RTFM won't work coz there is no such a thing...
Jump to: