With a similar intend as in #163, I started to extract all RPC errors which may or may not be optimized and unified:
JSONRPCError(RPC_INTERNAL_ERROR, "Internal Error: Failed to read block from disk");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Exception: blockHash is 0");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Exception: blockHash is 0, is transaction unconfirmed?");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Exception: crowdsale is flagged active but cannot be found in CrowdMap");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Exception: Crowdsale Purchase but Property ID does not exist. This may be a bug.");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Exception: pBlockIndex is NULL, is transaction unconfirmed?");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Not a Master Protocol transaction but TX exists in levelDB. This may be a bug.");
JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Not a Master Protocol transaction");
JSONRPCError(RPC_INVALID_PARAMETER, "Address not found");
JSONRPCError(RPC_INVALID_PARAMETER, "Desired property ID does not exist");
JSONRPCError(RPC_INVALID_PARAMETER, "Invalid address");
JSONRPCError(RPC_INVALID_PARAMETER, "Invalid property ID (Sale)");
JSONRPCError(RPC_INVALID_PARAMETER, "Invalid property ID (Want)");
JSONRPCError(RPC_INVALID_PARAMETER, "Invalid property ID");
JSONRPCError(RPC_INVALID_PARAMETER, "Negative count");
JSONRPCError(RPC_INVALID_PARAMETER, "Negative end block");
JSONRPCError(RPC_INVALID_PARAMETER, "Negative from");
JSONRPCError(RPC_INVALID_PARAMETER, "Negative start block");
JSONRPCError(RPC_INVALID_PARAMETER, "Property ID does not exist (Sale) ");
JSONRPCError(RPC_INVALID_PARAMETER, "Property ID does not exist (Want) ");
JSONRPCError(RPC_INVALID_PARAMETER, "Property ID does not exist");
JSONRPCError(RPC_INVALID_PARAMETER, "Property IDs must be in the same ecosystem (main/test) ");
JSONRPCError(RPC_INVALID_PARAMETER, "Property was not created with a crowdsale");
JSONRPCError(RPC_INVALID_PARAMETER, "Property was not created with a manual issuance");
JSONRPCError(RPC_INVALID_PARAMETER, strprintf("error code= %i", code));
JSONRPCError(RPC_INVALID_PARAMETER, strprintf("error code= %i", rc));
JSONRPCError(RPC_TYPE_ERROR, "Invalid action (1,2, or 3 only)");
JSONRPCError(RPC_TYPE_ERROR, "Invalid amount (Sale)");
JSONRPCError(RPC_TYPE_ERROR, "Invalid amount (Want)");
JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
JSONRPCError(RPC_TYPE_ERROR, "Invalid referenceamount");
runtime_error("Cannot display MP transactions for a non-existent block.");
Hm. We haven't really progressed in this context, but I don't see a very high priority at the moment. I'm going to close this one and #163 for now. Let's call it postponed for now.
With a similar intend as in #163, I started to extract all RPC errors which may or may not be optimized and unified: