@@ -3,7 +3,7 @@ import testUtils, { GLOBAL, waitTillBeenCalled } from '../test-utils';
3
3
import RedisClient , { RedisClientType } from '.' ;
4
4
// import { RedisClientMultiCommandType } from './multi-command';
5
5
// import { RedisCommandRawReply, RedisModules, RedisFunctions, RedisScripts } from '../commands';
6
- import { AbortError , ClientClosedError , ClientOfflineError , ConnectionTimeoutError , DisconnectsClientError , SocketClosedUnexpectedlyError , WatchError } from '../errors' ;
6
+ import { AbortError , ClientClosedError , ClientOfflineError , ConnectionTimeoutError , DisconnectsClientError , ErrorReply , MultiErrorReply , SocketClosedUnexpectedlyError , WatchError } from '../errors' ;
7
7
import { defineScript } from '../lua-script' ;
8
8
import { spy } from 'sinon' ;
9
9
import { once } from 'node:events' ;
@@ -282,6 +282,23 @@ describe('Client', () => {
282
282
// ...GLOBAL.SERVERS.OPEN,
283
283
// minimumDockerVersion: [6, 2] // CLIENT INFO
284
284
// });
285
+
286
+
287
+ testUtils . testWithClient ( 'should handle error replies (#2665)' , async client => {
288
+ await assert . rejects (
289
+ client . multi ( )
290
+ . set ( 'key' , 'value' )
291
+ . hGetAll ( 'key' )
292
+ . exec ( ) ,
293
+ err => {
294
+ assert . ok ( err instanceof MultiErrorReply ) ;
295
+ assert . equal ( err . replies . length , 2 ) ;
296
+ assert . deepEqual ( err . errorIndexes , [ 1 ] ) ;
297
+ assert . ok ( err . replies [ 1 ] instanceof ErrorReply ) ;
298
+ return true ;
299
+ }
300
+ ) ;
301
+ } , GLOBAL . SERVERS . OPEN ) ;
285
302
} ) ;
286
303
287
304
testUtils . testWithClient ( 'scripts' , async client => {
0 commit comments