1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/packages/client/lib/errors.ts
Leibale Eidelman 23b65133c9 New RESP2 parser (#1899)
* parser

* a new RESP parser :)

* clean code

* fix simple string and bulk string cursor

* performance improvements

* change typescript compiler target

* do not use stream.Transform

* Update decoder.ts

* fix for 1d09acb

* improve integer performance

* revert 1d09acb

* improve RESP2 decoder performance

* improve performance

* improve encode performance

* remove unused import

* upgrade benchmark deps

* clean code

* fix socket error handlers, reset parser on error

* fix #2080 - reset pubSubState on socket error

* reset decoder on socket error

* fix pubsub

* fix "RedisSocketInitiator"

* fix returnStringsAsBuffers

* fix merge
2022-04-25 08:24:33 -04:00

60 lines
1.3 KiB
TypeScript

export class AbortError extends Error {
constructor() {
super('The command was aborted');
}
}
export class WatchError extends Error {
constructor() {
super('One (or more) of the watched keys has been changed');
}
}
export class ConnectionTimeoutError extends Error {
constructor() {
super('Connection timeout');
}
}
export class ClientClosedError extends Error {
constructor() {
super('The client is closed');
}
}
export class DisconnectsClientError extends Error {
constructor() {
super('Disconnects client');
}
}
export class SocketClosedUnexpectedlyError extends Error {
constructor() {
super('Socket closed unexpectedly');
}
}
export class RootNodesUnavailableError extends Error {
constructor() {
super('All the root nodes are unavailable');
}
}
export class ReconnectStrategyError extends Error {
originalError: Error;
socketError: unknown;
constructor(originalError: Error, socketError: unknown) {
super(originalError.message);
this.originalError = originalError;
this.socketError = socketError;
}
}
export class ErrorReply extends Error {
constructor(message: string) {
super(message);
this.stack = undefined;
}
}