1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Update doctest client with latest v4 release (#2844)

This commit is contained in:
Shaya Potter
2024-09-29 13:19:06 +03:00
committed by GitHub
parent fd7b10be6c
commit 49fdb79897
167 changed files with 8227 additions and 9599 deletions

View File

@@ -1,3 +1,5 @@
import { RedisCommandRawReply } from './commands';
export class AbortError extends Error {
constructor() {
super('The command was aborted');
@@ -63,3 +65,20 @@ export class ErrorReply extends Error {
this.stack = undefined;
}
}
export class MultiErrorReply extends ErrorReply {
replies;
errorIndexes;
constructor(replies: Array<RedisCommandRawReply | ErrorReply>, errorIndexes: Array<number>) {
super(`${errorIndexes.length} commands failed, see .replies and .errorIndexes for more information`);
this.replies = replies;
this.errorIndexes = errorIndexes;
}
*errors() {
for (const index of this.errorIndexes) {
yield this.replies[index];
}
}
}