Bitcoin Forum
June 24, 2017, 03:56:26 AM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: JSON-RPC error code format?  (Read 2478 times)
Mabsark
Legendary
*
Offline Offline

Activity: 826


View Profile
July 31, 2011, 04:28:10 AM
 #1

What's the format for the error codes and does anyone know where I can find this info?

"result":
"error": What goes here?
"id":

Is it a fixed format like "id" or does the format vary like the value of result?
1498276586
Hero Member
*
Offline Offline

Posts: 1498276586

View Profile Personal Message (Offline)

Ignore
1498276586
Reply with quote  #2

1498276586
Report to moderator
1498276586
Hero Member
*
Offline Offline

Posts: 1498276586

View Profile Personal Message (Offline)

Ignore
1498276586
Reply with quote  #2

1498276586
Report to moderator
1498276586
Hero Member
*
Offline Offline

Posts: 1498276586

View Profile Personal Message (Offline)

Ignore
1498276586
Reply with quote  #2

1498276586
Report to moderator
Satoshi is no god. He did not come down from the mountain with 10 golden rules engraved in stone for no one to question.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1498276586
Hero Member
*
Offline Offline

Posts: 1498276586

View Profile Personal Message (Offline)

Ignore
1498276586
Reply with quote  #2

1498276586
Report to moderator
1498276586
Hero Member
*
Offline Offline

Posts: 1498276586

View Profile Personal Message (Offline)

Ignore
1498276586
Reply with quote  #2

1498276586
Report to moderator
1498276586
Hero Member
*
Offline Offline

Posts: 1498276586

View Profile Personal Message (Offline)

Ignore
1498276586
Reply with quote  #2

1498276586
Report to moderator
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 31, 2011, 12:57:46 PM
 #2

I followed the JSON-RPC-2.0 spec for errors, as described here:
  http://groups.google.com/group/json-rpc/web/json-rpc-2-0?pli=1
(see section 5.1)

... with several bitcoin-specific additional error codes that I'd have to look at the source code to remember.

I thought I'd documented the additional bitcoin error codes, but maybe that information got lost in the wiki move that happened last year or maybe I'm mis-remembering.  Quick grep through rpc.cpp gives:

Code:
(-10, "Bitcoin is downloading blocks...");
(-11, "Invalid account name");
(-12, "Error: Keypool ran out, please call keypoolrefill first");
(-12, "Error: Keypool ran out, please call topupkeypool first");
(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
(-14, "Error: The wallet passphrase entered was incorrect.");
(-15, "Error: running with an encrypted wallet, but encryptwallet was called.");
(-15, "Error: running with an unencrypted wallet, but walletlock was called.");
(-15, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
(-15, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
(-16, "Error: Failed to encrypt the wallet.");
(-17, "Error: Wallet is already unlocked.");
(-2, string("Safe mode: ") + strWarning);
(-3, "Invalid amount");
(-32600, "Method must be a string");
(-32600, "Missing method");
(-32600, "Params must be an array");
(-32601, "Method not found");
(-32700, "Parse error");
(-4, "Error refreshing keypool.");
(-4, "Transaction commit failed");
(-4, "Transaction creation failed");
(-5, "Invalid bitcoin address");
(-5, "Invalid or non-wallet transaction id");
(-5, string("Invalid bitcoin address:")+s.name_);
(-6, "Account has insufficient funds");
(-6, "Insufficient funds");
(-7, "Out of memory");
(-8, "Invalid parameter");
(-8, string("Invalid parameter, duplicated address: ")+s.name_);
(-9, "Bitcoin is not connected!");

How often do you get the chance to work on a potentially world-changing project?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!