Bitcoin Forum
November 19, 2017, 09:13:56 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Annoying HTTP 500 error  (Read 864 times)
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1764

Newbie


View Profile
September 24, 2013, 08: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...
Join ICO Now Coinlancer is Disrupting the Freelance marketplace!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511082836
Hero Member
*
Offline Offline

Posts: 1511082836

View Profile Personal Message (Offline)

Ignore
1511082836
Reply with quote  #2

1511082836
Report to moderator
Foxpup
Legendary
*
Offline Offline

Activity: 2016



View Profile
September 24, 2013, 10: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

Will pretend to do unverifiable things (while actually eating an enchilada-style burrito) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1764

Newbie


View Profile
September 24, 2013, 10: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.
davout
Legendary
*
Offline Offline

Activity: 1372


1davout


View Profile WWW
September 24, 2013, 10:23:53 AM
 #4

What do you expect it to do?

HTTP 422.

dserrano5
Legendary
*
Offline Offline

Activity: 1848



View Profile
September 24, 2013, 02:11:53 PM
 #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.

DoRob
Member
**
Offline Offline

Activity: 70


View Profile
September 24, 2013, 02:12:50 PM
 #6

Error 500 = Internal Server Error

1DoRobFUcdcsnS4cDAPsGkqAGiWzacQ94p
davout
Legendary
*
Offline Offline

Activity: 1372


1davout


View Profile WWW
September 24, 2013, 02:13:55 PM
 #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".

dserrano5
Legendary
*
Offline Offline

Activity: 1848



View Profile
September 24, 2013, 02:33:04 PM
 #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.

davout
Legendary
*
Offline Offline

Activity: 1372


1davout


View Profile WWW
September 24, 2013, 02:55:32 PM
 #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.

Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1764

Newbie


View Profile
September 24, 2013, 04:02:27 PM
 #10

Guys, the number doesn't matter. I need a description of an error, so I don't need to guess what's happened.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!