mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

RPC errors #165

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

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.");
m21 commented 9 years ago

Does this help? https://github.com/mastercoin-MSC/mastercore/pull/166

Pulled the commit: https://github.com/mastercoin-MSC/mastercore/commit/89a2ba8c1f9e7ac7e2d6eae5acb780d02674732b

m21 commented 9 years ago

Good to close @dexX7 ?

dexX7 commented 9 years ago

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.