{"_id":"redis-errors","_rev":"123699","name":"redis-errors","description":"Error classes used in node_redis","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"bridgear","email":"ruben@bridgewater.de"},{"name":"salakar","email":"mike.diarmid@gmail.com"}],"time":{"modified":"2021-06-03T10:59:20.000Z","created":"2017-05-19T01:00:08.140Z","1.2.0":"2017-06-01T00:22:49.218Z","1.1.0":"2017-05-26T05:40:26.159Z","1.0.0":"2017-05-19T01:00:08.140Z"},"users":{},"author":{"name":"Ruben Bridgewater"},"repository":{"type":"git","url":"git+https://github.com/NodeRedis/redis-errors.git"},"versions":{"1.2.0":{"name":"redis-errors","version":"1.2.0","description":"Error classes used in node_redis","main":"index.js","scripts":{"test":"npm run coverage","lint":"standard --fix","posttest":"npm run lint && npm run coverage:check","coverage":"node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -R spec","coverage:check":"node ./node_modules/istanbul/lib/cli.js check-coverage --statement 100"},"repository":{"type":"git","url":"git+https://github.com/NodeRedis/redis-errors.git"},"keywords":["redis","javascript","node","error"],"engines":{"node":">=4"},"devDependencies":{"istanbul":"^0.4.0","mocha":"^3.1.2","standard":"^10.0.0"},"author":{"name":"Ruben Bridgewater"},"license":"MIT","bugs":{"url":"https://github.com/NodeRedis/redis-errors/issues"},"homepage":"https://github.com/NodeRedis/redis-errors#readme","directories":{"test":"test","lib":"lib"},"gitHead":"bab55fccea876759b79570b172f59359f8a2503a","_id":"redis-errors@1.2.0","_shasum":"eb62d2adb15e4eaf4610c04afe1529384250abad","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"bridgear","email":"ruben@bridgewater.de"},"dist":{"shasum":"eb62d2adb15e4eaf4610c04afe1529384250abad","size":3351,"noattachment":false,"key":"/redis-errors/-/redis-errors-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/redis-errors/download/redis-errors-1.2.0.tgz"},"maintainers":[{"name":"bridgear","email":"ruben@bridgewater.de"},{"name":"salakar","email":"mike.diarmid@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redis-errors-1.2.0.tgz_1496276567949_0.4530253552366048"},"publish_time":1496276569218,"_cnpm_publish_time":1496276569218,"_hasShrinkwrap":false},"1.1.0":{"name":"redis-errors","version":"1.1.0","description":"Error classes used in node_redis","main":"index.js","scripts":{"test":"npm run coverage","lint":"standard --fix","posttest":"npm run lint && npm run coverage:check","coverage":"node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -R spec","coverage:check":"node ./node_modules/istanbul/lib/cli.js check-coverage --branch 100 --statement 100"},"repository":{"type":"git","url":"git+https://github.com/NodeRedis/node-redis-parser.git"},"keywords":["redis","javascript","node","error"],"engines":{"node":">=4"},"devDependencies":{"istanbul":"^0.4.0","mocha":"^3.1.2","standard":"^10.0.0"},"author":{"name":"Ruben Bridgewater"},"license":"MIT","bugs":{"url":"https://github.com/NodeRedis/redis-errors/issues"},"homepage":"https://github.com/NodeRedis/redis-errors#readme","directories":{"test":"test","lib":"lib"},"gitHead":"c7fcd1674d8d312dc062be2f1ef9c10ac60fe32f","_id":"redis-errors@1.1.0","_shasum":"71d1662a59f3297982ac8bb3d4846910510b80a8","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"bridgear","email":"ruben@bridgewater.de"},"dist":{"shasum":"71d1662a59f3297982ac8bb3d4846910510b80a8","size":2958,"noattachment":false,"key":"/redis-errors/-/redis-errors-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/redis-errors/download/redis-errors-1.1.0.tgz"},"maintainers":[{"name":"bridgear","email":"ruben@bridgewater.de"},{"name":"salakar","email":"mike.diarmid@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redis-errors-1.1.0.tgz_1495777225097_0.061890311539173126"},"publish_time":1495777226159,"_hasShrinkwrap":false,"_cnpm_publish_time":1495777226159},"1.0.0":{"name":"redis-errors","version":"1.0.0","description":"Error classes used in node_redis","main":"index.js","scripts":{"test":"npm run coverage","lint":"standard --fix","posttest":"npm run lint && npm run coverage:check","coverage":"node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -R spec","coverage:check":"node ./node_modules/istanbul/lib/cli.js check-coverage --branch 100 --statement 100"},"repository":{"type":"git","url":"git+https://github.com/NodeRedis/node-redis-parser.git"},"keywords":["redis","javascript","node","error"],"engines":{"node":">=4"},"devDependencies":{"buffer-from":"^0.1.1","istanbul":"^0.4.0","mocha":"^3.1.2","standard":"^10.0.0"},"author":{"name":"Ruben Bridgewater"},"license":"MIT","bugs":{"url":"https://github.com/NodeRedis/redis-errors/issues"},"homepage":"https://github.com/NodeRedis/redis-errors#readme","directories":{"test":"test","lib":"lib"},"gitHead":"69004c7cde5014e88df854d9b428401648bdd7f9","_id":"redis-errors@1.0.0","_shasum":"b884b971efdcd86caac5635cf756d571b04d4ed0","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"bridgear","email":"ruben@bridgewater.de"},"dist":{"shasum":"b884b971efdcd86caac5635cf756d571b04d4ed0","size":2217,"noattachment":false,"key":"/redis-errors/-/redis-errors-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/redis-errors/download/redis-errors-1.0.0.tgz"},"maintainers":[{"name":"bridgear","email":"ruben@bridgewater.de"},{"name":"salakar","email":"mike.diarmid@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/redis-errors-1.0.0.tgz_1495155606831_0.11374054453335702"},"publish_time":1495155608140,"_hasShrinkwrap":false,"_cnpm_publish_time":1495155608140}},"readme":"[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\n# redis-errors\n\nAll error classes used in [node_redis](https://github.com/NodeRedis/node_redis)\nfrom v.3.0.0 are in here. They can be required as needed.\n\n## Install\n\nInstall with [NPM](https://npmjs.org/):\n\n  npm install redis-errors\n\n## Usage\n\n```js\nconst { ReplyError, InterruptError } = require('redis-errors');\n\n// Using async await\ntry {\n  await client.set('foo') // Missing value\n} catch (err) {\n  if (err instanceof InterruptError) {\n    console.error('Command might have been processed')\n  }\n  if (err instanceof ReplyError) {\n    // ...\n  }\n  throw err\n}\n\n// Using callbacks\nclient.set('foo', (err, res) => {\n  if (err) {\n    if (err instanceof InterruptError) {\n      // ...\n    }\n  }\n})\n```\n\n### Error classes\n\nAll errors returned by NodeRedis use own Error classes. You can distinguish\ndifferent errors easily by checking for these classes.\n\nTo know what caused the error they might contain properties to know in more\ndetail what happened.\n\nEach error contains a `message`, a `name` and a `stack` property. Please be aware\nthat the stack might not be useful due to the async nature and is in those cases\ntherefore limited to two frames.\n\nThere might be more not yet documented properties as well. Please feel free to\nopen a pull request to document those as well.\n\n#### RedisError\n\n`Properties`:\n\nProperties depend on the individual error.\n\nAll errors returned by NodeRedis (client) are `RedisError`s.  \nSubclass of `Error`\n\n#### ReplyError\n\n`Properties`:\n\n* `args`: The arguments passed to the command.\n* `command`: The command name.\n* `code`: The `Redis` error code. Redis itself uses some internal error codes.\n\nAll errors returned by Redis itself (server) will be a `ReplyError`.  \nSubclass of `RedisError`\n\n#### ParserError\n\n`Properties`:\n\n* `buffer`: The raw buffer input stringified.\n* `offset`: The character count where the parsing error occurred.\n\nParsing errors are returned as `ParserError`.  \nSubclass of `RedisError`\n**Note:** If you encounter one of these please report that error including the\nattached `offset` and `buffer` properties!  \n\n#### AbortError\n\n`Properties`:\n\n* `args`: The arguments passed to the command.\n* `command`: The command name.\n\nIf a command was not yet executed but rejected, it'll return a `AbortError`.  \nSubclass of `RedisError`\n\n#### InterruptError\n\n`Properties`:\n\n* `args`: The arguments passed to the command.\n* `command`: The command name.\n* `origin`: The original error that caused the interrupt\n\nAll executed commands that could not fulfill (e.g. network drop while\nexecuting) return a `InterruptError`.  \nSubclass of `AbortError`  \n**Note:** Interrupt errors can happen for multiple reasons that are out of the\nscope of NodeRedis itself. There is nothing that can be done on library side\nto prevent those.\n\n## License\n\n[MIT](./LICENSE)\n","_attachments":{},"homepage":"https://github.com/NodeRedis/redis-errors#readme","bugs":{"url":"https://github.com/NodeRedis/redis-errors/issues"},"license":"MIT"}