RPC errors raised by each command 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).
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.