<p>The code for the <code>_rawtransaction</code> RPCs is in <a href="https://github.com/bitcoin/bitcoin/blob/master/src/rpc/rawtransaction.cpp" rel="nofollow noreferrer">/src/rpc/rawtransaction.cpp</a> including your example of the &quot;TX decode failed&quot; error message.</p>
<p>If you do a <code>Ctrl-F</code> or <code>git grep</code> in that file for <code>JSONRPCError</code> you'll see some of the other error messages but that may not be an exhaustive list.</p>

CC BY-SA 4.0
2023-07-30T12:45:51.480Z
2023-07-30T12:45:51.480Z
Michael Folkson
<p>Where can I find the list of all possible <code>sendrawtransaction</code> RPC error codes &amp; messages?</p>
<p>Such as this:
<code>{&quot;code&quot;:-22,&quot;message&quot;:&quot;TX decode failed. Make sure the tx has at least one input.&quot;}</code></p>

<json-rpc><bitcoin-core-development><sendrawtransaction>
Where can I find the list of all possible sendrawtransaction RPC error codes & messages?
jiamijiang
# Where can I find the list of all possible sendrawtransaction RPC error codes & messages?

(Asked by: username_0 on 2023-07-30)

Where can I find the list of all possible `sendrawtransaction` RPC error codes & messages?

Such as this:
`{"code":-22,"message":"TX decode failed. Make sure the tx has at least one input."}`

**Tags:** json-rpc, bitcoin-core-development, sendrawtransaction


---

## 1 answers

### Answer by username_1 on 2023-07-30. Score: 2

The code for the `_rawtransaction` RPCs is in [/src/rpc/rawtransaction.cpp](https://github.com/bitcoin/bitcoin/blob/master/src/rpc/rawtransaction.cpp) including your example of the "TX decode failed" error message.

If you do a `Ctrl-F` or `git grep` in that file for `JSONRPCError` you'll see some of the other error messages but that may not be an exhaustive list.


---

