1

Coming from this question, is there any comprehensive collection of what errors can each RPC command return?

For example. Let's say I want to run getbestblockhash or getblockcount. I'm unsure about what errors to expect. Furthermore, I'm unsure if there's a generic error code that can be return in many cases (RPC_MISC_ERROR for example).

2

Coming from this question, is there any comprehensive collection of what errors can each RPC command return?

For example. Let's say I want to run getbestblockhash or getblockcount. I'm unsure about what errors to expect.

I don't think that such documentation exists. You would have to read the source code for a particular RPC. Additionally, since some functions are shared between RPCs and can return specific errors, it may not be easy to enumerate all of the errors.

Furthermore, I'm unsure if there's a generic error code that can be return in many cases (RPC_MISC_ERROR for example).

If there's an error which doesn't have its own specific catching and checking (i.e. an exception is thrown that the RPC doesn't catch), then RPC_MISC_ERROR will be returned.

| improve this answer | |
  • Thanks Andrew. I'll wait a bit to see if someone has done the heavy lifting :( Am I at least safe to assume that any unexpected error will default to RPC_MISC_ERROR ? – sr-gi Nov 18 '19 at 16:46
  • 1
    Yes, you can assume that unexpected errors default to RPC_MISC_ERROR. – Andrew Chow Nov 18 '19 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.