JSPM

redis-errors

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7525684
  • Score
    100M100P100Q200925F
  • License MIT

Error classes used in node_redis

Package Exports

  • redis-errors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redis-errors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status js-standard-style

redis-errors

All error classes used in node_redis from v.3.0.0 are in here. They can be required as needed.

Install

Install with NPM:

npm install redis-errors

Usage

const { RedisError, ReplyError } = require('redis-errors');

// Using async await
try {
  return client.set('foo') // Missing value
} catch (err) {
  if (err instanceof ReplyError) {
    console.log(err)
  }
  throw err
}

Error classes

  • RedisError sub class of Error
  • ReplyError sub class of RedisError
  • ParserError sub class of RedisError

All Redis errors will be returned as ReplyErrors while a parser error is returned as ParserError.

License

MIT