user2751: As far as I understand, if you supply a made up TxID to the getrawtransaction RPC API, it should return an error code that suggests the record is not found (i.e. 404 HTTP STATUS CODE?). However, in bitcoin-core 0.12.1 and 0.13.1 it's returning 500-Internal Server Error, as if the node had some problem processing the request.
FYI, I have txindex=1 enabled in this node, so it's not because of the lack of data. Should this be fixed upstream or is it already fixed? Or is there a better reason for why this is the case?

user2306: It should return HTTP status 500 if the transaction doesn't exist. 404 is just for method-does-not-exist errors. (See here.) Reading the code, I don't see how error 404 could be returned for a transaction not existing. (I checked the current code and 0.13.)
HTTP status codes are pretty non-specific. You should parse the JSON response if you want something more specific than 'an error happened.' (But it doesn't always return JSON. IIRC, 401 Authorization errors aren't JSON.)

2751: <p>As far as I understand, if you supply a made up TxID to the <code>getrawtransaction</code> RPC API, it should return an error code that suggests the record is not found (i.e. 404 HTTP STATUS CODE?). However, in bitcoin-core 0.12.1 and 0.13.1 it's returning 500-Internal Server Error, as if the node had some problem processing the request.</p>

<p>FYI, I have <code>txindex=1</code> enabled in this node, so it's not because of the lack of data. Should this be fixed upstream or is it already fixed? Or is there a better reason for why this is the case?</p>
 2306: <p>It should return HTTP status 500 if the transaction doesn't exist. 404 is just for method-does-not-exist errors. (See <a href="https://github.com/bitcoin/bitcoin/blob/master/src/rpc/protocol.h#L38" rel="nofollow noreferrer">here</a>.) Reading the code, I don't see how error 404 could be returned for a transaction not existing. (I checked the current code and 0.13.)</p>

<p>HTTP status codes are pretty non-specific. You should parse the JSON response if you want something more specific than 'an error happened.' (But it doesn't always return JSON. IIRC, 401 Authorization errors aren't JSON.)</p>
