Registry / database / redis-errors

redis-errors

JSON →
library1.2.0jsnpmunverified

Error classes for NodeRedis (node_redis) v3.0.0+. Provides a hierarchy of Redis-related error types to distinguish client/server/parsing/abort/interrupt errors. Includes RedisError, ReplyError, ParserError, AbortError, and InterruptError. Last released v1.2.0 with Node >=4 support. Not actively updated; maintained as a dependency of node_redis.

npm install redis-errors
INSTALL
IMPORT
SIG · REDIS-ERRORS
R
redis-errors
databasejavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisError
import { RedisError } from 'redis-errors'
const RedisError = require('redis-errors').RedisError
You can use destructured require or ESM import.
ReplyError
const { ReplyError } = require('redis-errors')
const ReplyError = require('redis-errors/ReplyError')
Direct path imports like 'redis-errors/ReplyError' are not part of the public API; import from the main package.
AbortError
import { AbortError } from 'redis-errors'

Shows how to import and use error classes to handle different Redis client errors.

const { ReplyError, InterruptError } = require('redis-errors'); const redis = require('redis'); const client = redis.createClient(); async function example() { try { await client.set('foo'); // missing value } catch (err) { if (err instanceof InterruptError) { console.error('Command might have been processed'); } else if (err instanceof ReplyError) { console.error('Redis server error:', err.message); } else { throw err; } } } example();
Debug
Known issues
breakingNode.js <4 is not supported. Requires Node >=4.
fix
Upgrade Node.js to version >=4.
affects: >=0.1.0 <1.2.0
deprecatedPackage is in maintenance mode; no active development. Use it only as a dependency of node_redis.
fix
Consider alternatives like ioredis which has its own error handling.
affects: >=1.0.0
gotchaSubclass hierarchy: InterruptError extends AbortError, which extends RedisError. Use specific error classes for precise handling.
fix
Check for InterruptError before AbortError to catch more specific errors.
affects: >=1.0.0
Errors
Common errors & fixes
RedisError is not defined
Importing from wrong path or using wrong syntax.
fix
Use: const { RedisError } = require('redis-errors');
Cannot find module 'redis-errors'
Package not installed.
fix
Run: npm install redis-errors
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Resources
redis-errors — npm install redis-errors · libregistry