More accurate Redis Error types (#43916)

Co-authored-by: David Stephens <david.2.stephens@bt.com>
This commit is contained in:
David Stephens
2020-04-17 15:59:11 -07:00
committed by GitHub
co-authored by David Stephens
parent 753525d1fc
commit 25e7ecb2bf
2 changed files with 17 additions and 5 deletions
+8 -3
View File
@@ -1248,12 +1248,17 @@ export function createClient(options?: ClientOpts): RedisClient;
export function print(err: Error | null, reply: any): void;
export class RedisError extends Error {
export class RedisError extends Error { }
export class ReplyError extends RedisError {
command: string;
args?: any[];
code: string;
}
export class AbortError extends RedisError {
command: string;
args?: any[];
code?: string;
}
export class ReplyError extends RedisError { }
export class AbortError extends RedisError { }
export class ParserError extends RedisError {
offset: number;
buffer: Buffer;
+9 -2
View File
@@ -1231,11 +1231,18 @@ export function createClient(options?: ClientOpts): RedisClient;
export function print(err: Error | null, reply: any): void;
export class RedisError extends Error {
name: string;
}
export class ReplyError extends RedisError {
command: string;
args?: unknown[];
code: string;
}
export class AbortError extends RedisError {
command: string;
args?: unknown[];
code?: string;
}
export class ReplyError extends RedisError { }
export class AbortError extends RedisError { }
export class ParserError extends RedisError {
offset: number;
buffer: Buffer;