Bitcoin Forum
May 07, 2024, 08:44:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Annoying HTTP 500 error  (Read 979 times)
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

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...
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715114662
Hero Member
*
Offline Offline

Posts: 1715114662

View Profile Personal Message (Offline)

Ignore
1715114662
Reply with quote  #2

1715114662
Report to moderator
1715114662
Hero Member
*
Offline Offline

Posts: 1715114662

View Profile Personal Message (Offline)

Ignore
1715114662
Reply with quote  #2

1715114662
Report to moderator
1715114662
Hero Member
*
Offline Offline

Posts: 1715114662

View Profile Personal Message (Offline)

Ignore
1715114662
Reply with quote  #2

1715114662
Report to moderator
Foxpup
Legendary
*
Offline Offline

Activity: 4354
Merit: 3044


Vile Vixen and Miss Bitcointalk 2021-2023


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 unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

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
Merit: 1007


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: 1974
Merit: 1029



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
Merit: 10


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

Error 500 = Internal Server Error

1DoRobFUcdcsnS4cDAPsGkqAGiWzacQ94p
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


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: 1974
Merit: 1029



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
Merit: 1007


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 (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!