{"_id":"json-rpc-error","_rev":"4629209","name":"json-rpc-error","description":"JSON RPC 2.0 Errors.","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"claudijo","email":""}],"time":{"modified":"2026-04-10T18:47:13.000Z","created":"2015-07-23T23:51:37.645Z","2.0.0":"2015-07-30T13:48:44.065Z","1.0.3":"2015-07-30T11:33:29.942Z","1.0.2":"2015-07-29T13:43:08.289Z","1.0.1":"2015-07-24T00:06:30.292Z","1.0.0":"2015-07-23T23:51:37.645Z"},"users":{},"author":{"name":"Claudijo Borovic","email":"hello@claudijo.com"},"repository":{"type":"git","url":"git+https://github.com/claudijo/json-rpc-error.git"},"versions":{"2.0.0":{"name":"json-rpc-error","version":"2.0.0","description":"JSON RPC 2.0 Errors.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha --check-leaks --reporter spec --bail ./test --recursive --watch","test-cov":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks ./test --recursive"},"repository":{"type":"git","url":"git+https://github.com/claudijo/json-rpc-error.git"},"keywords":["json","rpc","error"],"author":{"name":"Claudijo Borovic","email":"hello@claudijo.com"},"license":"MIT","bugs":{"url":"https://github.com/claudijo/json-rpc-error/issues"},"homepage":"https://github.com/claudijo/json-rpc-error","dependencies":{"inherits":"^2.0.1"},"files":["LICENSE","index.js","lib"],"devDependencies":{"istanbul":"^0.3.17","mocha":"^2.2.5"},"gitHead":"7112cf003974b0dc505e2d4314a041369e91b5f3","_id":"json-rpc-error@2.0.0","_shasum":"a7af9c202838b5e905c7250e547f1aff77258a02","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.36","_npmUser":{"name":"claudijo","email":"claudijo.borovic@gmail.com"},"maintainers":[{"name":"claudijo","email":""}],"dist":{"shasum":"a7af9c202838b5e905c7250e547f1aff77258a02","size":2648,"noattachment":false,"key":"/json-rpc-error/-/json-rpc-error-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-rpc-error/download/json-rpc-error-2.0.0.tgz"},"directories":{},"publish_time":1438264124065,"_hasShrinkwrap":false,"_cnpm_publish_time":1438264124065,"_cnpmcore_publish_time":"2021-12-16T15:32:46.014Z"},"1.0.3":{"name":"json-rpc-error","version":"1.0.3","description":"JSON RPC 2.0 Errors.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha --check-leaks --reporter spec --bail ./test --recursive --watch","test-cov":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks ./test --recursive"},"repository":{"type":"git","url":"git+https://github.com/claudijo/json-rpc-error.git"},"keywords":["json","rpc","error"],"author":{"name":"Claudijo Borovic","email":"hello@claudijo.com"},"license":"MIT","bugs":{"url":"https://github.com/claudijo/json-rpc-error/issues"},"homepage":"https://github.com/claudijo/json-rpc-error","dependencies":{"inherits":"^2.0.1"},"files":["LICENSE","index.js","lib"],"devDependencies":{"istanbul":"^0.3.17","mocha":"^2.2.5"},"gitHead":"f874cd2b191ad7808cb13c14c42f675045b46dc1","_id":"json-rpc-error@1.0.3","_shasum":"4409f98d9abf19671205639935fc731203c34482","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.36","_npmUser":{"name":"claudijo","email":"claudijo.borovic@gmail.com"},"maintainers":[{"name":"claudijo","email":""}],"dist":{"shasum":"4409f98d9abf19671205639935fc731203c34482","size":2658,"noattachment":false,"key":"/json-rpc-error/-/json-rpc-error-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-rpc-error/download/json-rpc-error-1.0.3.tgz"},"directories":{},"publish_time":1438256009942,"_hasShrinkwrap":false,"_cnpm_publish_time":1438256009942,"_cnpmcore_publish_time":"2021-12-16T15:32:46.214Z"},"1.0.2":{"name":"json-rpc-error","version":"1.0.2","description":"JSON RPC 2.0 Errors.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha --check-leaks --reporter spec --bail ./test --recursive --watch","test-cov":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks ./test --recursive"},"repository":{"type":"git","url":"git+https://github.com/claudijo/json-rpc-error.git"},"keywords":["json","rpc","error"],"author":{"name":"Claudijo Borovic","email":"hello@claudijo.com"},"license":"MIT","bugs":{"url":"https://github.com/claudijo/json-rpc-error/issues"},"homepage":"https://github.com/claudijo/json-rpc-error","dependencies":{"inherits":"^2.0.1"},"files":["LICENSE","index.js","lib"],"devDependencies":{"istanbul":"^0.3.17","mocha":"^2.2.5"},"gitHead":"05f2856bf8063065e5d112ee3ac6544378ec6422","_id":"json-rpc-error@1.0.2","_shasum":"460174bd74354ddbe54322282ff471b3ae11d26c","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.36","_npmUser":{"name":"claudijo","email":"claudijo.borovic@gmail.com"},"maintainers":[{"name":"claudijo","email":""}],"dist":{"shasum":"460174bd74354ddbe54322282ff471b3ae11d26c","size":2655,"noattachment":false,"key":"/json-rpc-error/-/json-rpc-error-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-rpc-error/download/json-rpc-error-1.0.2.tgz"},"directories":{},"publish_time":1438177388289,"_hasShrinkwrap":false,"_cnpm_publish_time":1438177388289,"_cnpmcore_publish_time":"2021-12-16T15:32:46.407Z"},"1.0.1":{"name":"json-rpc-error","version":"1.0.1","description":"JSON RPC 2.0 Errors.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha --check-leaks --reporter spec --bail ./test --recursive --watch","test-cov":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks ./test --recursive"},"repository":{"type":"git","url":"git+https://github.com/claudijo/json-rpc-error.git"},"keywords":["json","rpc","error"],"author":{"name":"Claudijo Borovic","email":"hello@claudijo.com"},"license":"MIT","bugs":{"url":"https://github.com/claudijo/json-rpc-error/issues"},"homepage":"https://github.com/claudijo/json-rpc-error","dependencies":{"inherits":"^2.0.1"},"files":["LICENSE","index.js","lib"],"devDependencies":{"istanbul":"^0.3.17","mocha":"^2.2.5"},"gitHead":"8eb9faa806200a095d506af8960f7831a9113f97","_id":"json-rpc-error@1.0.1","_shasum":"3a549278fc7e2c5033e7565d8083784f62184619","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.36","_npmUser":{"name":"claudijo","email":"claudijo.borovic@gmail.com"},"maintainers":[{"name":"claudijo","email":""}],"dist":{"shasum":"3a549278fc7e2c5033e7565d8083784f62184619","size":2601,"noattachment":false,"key":"/json-rpc-error/-/json-rpc-error-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-rpc-error/download/json-rpc-error-1.0.1.tgz"},"directories":{},"publish_time":1437696390292,"_hasShrinkwrap":false,"_cnpm_publish_time":1437696390292,"_cnpmcore_publish_time":"2021-12-16T15:32:46.610Z"},"1.0.0":{"name":"json-rpc-error","version":"1.0.0","description":"JSON RPC 2.0 Errors.","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha --check-leaks --reporter spec --bail ./test --recursive --watch","test-cov":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks ./test --recursive"},"repository":{"type":"git","url":"git+https://github.com/claudijo/json-rpc-error.git"},"keywords":["json","rpc","error"],"author":{"name":"Claudijo Borovic","email":"hello@claudijo.com"},"license":"MIT","bugs":{"url":"https://github.com/claudijo/json-rpc-error/issues"},"homepage":"https://github.com/claudijo/json-rpc-error","dependencies":{"inherits":"^2.0.1"},"files":["LICENSE","index.js"],"devDependencies":{"istanbul":"^0.3.17","mocha":"^2.2.5"},"gitHead":"bbbcaadd9202dbd58494a507b799737cb591503a","_id":"json-rpc-error@1.0.0","_shasum":"b988afa1774dbf99a39fc74f331a0af48003a657","_from":".","_npmVersion":"2.11.0","_nodeVersion":"0.10.36","_npmUser":{"name":"claudijo","email":"claudijo.borovic@gmail.com"},"maintainers":[{"name":"claudijo","email":""}],"dist":{"shasum":"b988afa1774dbf99a39fc74f331a0af48003a657","size":2105,"noattachment":false,"key":"/json-rpc-error/-/json-rpc-error-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-rpc-error/download/json-rpc-error-1.0.0.tgz"},"directories":{},"publish_time":1437695497645,"_hasShrinkwrap":false,"_cnpm_publish_time":1437695497645,"_cnpmcore_publish_time":"2021-12-16T15:32:46.820Z"}},"readme":"# JSON RPC 2.0 Error\n\nError constructors for JSON RPC 2.0 errors as described in the\n[JSON-RPC 2.0 Error Specification]\n(http://www.jsonrpc.org/specification#error_object)\n\n| code             | message          | meaning                                                                                               |\n|------------------|------------------|-------------------------------------------------------------------------------------------------------|\n| -32700           | Parse error      | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |\n| -32600           | Invalid Request  | The JSON sent is not a valid Request object.                                                          |\n| -32601           | Method not found | The method does not exist / is not available.                                                         |\n| -32602           | Invalid params   | Invalid method parameter(s).                                                                          |\n| -32603           | Internal error   | Internal JSON-RPC error.                                                                              |\n| -32000 to -32099 | Server error     | Reserved for implementation-defined server-errors.                                                    |\n\nSpecific errors are instances of the base constructor `JsonRpcError`, which in\nturn is an instance of the native JavaScript Error object.\n\nEach error can be constructed with or without the `new` keyword, for example\n\n`var err = new JsonRpcError.ParseError();`\n\nis the same as\n\n`var err = JsonRpcError.ParseError();`\n\nAlso see related packages [json-rpc-response](https://github.com/claudijo/json-rpc-response),\n[json-rpc-request](https://github.com/claudijo/json-rpc-request), and\n[json-rpc-notification](https://github.com/claudijo/json-rpc-notification)\n\n## Usage\n\nImport the JSON RPC 2.0 error module:\n\n```js\nvar JsonRpcError = require('json-rpc-error');\n```\n\n### JsonRpcError\nGeneral base constructor for JSON RPC 2 errors:\n\n```js\nnew JsonRpcError(message, code[, data]);\n```\n\n### Parse error\nInvalid JSON was received by the server.\n\n```js\nnew JsonRpcError.ParseError();\n```\n\n### Invalid Request\nThe JSON sent is not a valid Request object.\n\n```js\nnew JsonRpcError.InvalidRequest();\n```\n\n### Method not found\nThe method does not exist / is not available.\n\n```js\nnew JsonRpcError.MethodNotFound();\n```\n\n### Invalid params\nInvalid method parameter(s).\n\n```js\nnew JsonRpcError.InvalidParams();\n```\n\n### Internal error\nInternal JSON-RPC error. The constructor can take an optional error object, in\nwhich case the error's `message` property will be passed on.\n\n```js\nnew JsonRpcError.InternalError([error]);\n```\n\n### Server Error\nReserved for implementation-defined server-errors. Provided error code must be\nin the range -32000 to -32099.\n\n```js\nnew JsonRpcError.ServerError(code);\n```\n\n## Test\n\nRun unit tests:\n\n`$ npm test`\n\nCreate test coverage report:\n\n`$ npm run-script test-cov`\n\n# License\n\n[MIT](LICENSE)\n\n\n","_attachments":{},"homepage":"https://github.com/claudijo/json-rpc-error","bugs":{"url":"https://github.com/claudijo/json-rpc-error/issues"},"license":"MIT"}