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
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 ErrorReplyError
sub class of RedisErrorParserError
sub class of RedisError
All Redis errors will be returned as ReplyErrors
while a parser error is returned as ParserError
.