@@ -254,16 +254,19 @@ describe("The 'multi' method", function () {
254
254
assert ( err . message . match ( / ^ E X E C A B O R T / ) , "Error message should begin with EXECABORT" ) ;
255
255
assert . equal ( err . errors . length , 2 , "err.errors should have 2 items" ) ;
256
256
assert . strictEqual ( err . errors [ 0 ] . command_used , 'SET' ) ;
257
+ assert . strictEqual ( err . errors [ 0 ] . code , 'ERR' ) ;
257
258
assert . strictEqual ( err . errors [ 0 ] . position , 1 ) ;
258
259
assert ( / ^ E R R / . test ( err . errors [ 0 ] . message ) , "Actuall error message should begin with ERR" ) ;
259
260
return done ( ) ;
260
261
} ) ;
261
262
} ) ;
262
263
263
264
it ( 'reports multiple exceptions when they occur (while EXEC is running)' , function ( done ) {
264
- client . multi ( ) . config ( "bar" ) . debug ( "foo" ) . exec ( function ( err , reply ) {
265
- assert . strictEqual ( reply . length , 2 ) ;
265
+ client . multi ( ) . config ( "bar" ) . debug ( "foo" ) . eval ( "return {err='this is an error'}" , 0 ) . exec ( function ( err , reply ) {
266
+ assert . strictEqual ( reply . length , 3 ) ;
266
267
assert . equal ( reply [ 0 ] . code , 'ERR' ) ;
268
+ assert . equal ( reply [ 2 ] . code , undefined ) ;
269
+ assert ( / ^ t h i s i s a n e r r o r / . test ( reply [ 2 ] . message ) ) ;
267
270
assert ( / ^ E R R / . test ( reply [ 0 ] . message ) , "Error message should begin with ERR" ) ;
268
271
assert ( / ^ E R R / . test ( reply [ 1 ] . message ) , "Error message should begin with ERR" ) ;
269
272
return done ( ) ;
@@ -276,6 +279,7 @@ describe("The 'multi' method", function () {
276
279
multi . set ( 'foo' , 'bar' , helper . isString ( 'OK' ) ) ;
277
280
multi . debug ( "foo" ) . exec ( function ( err , reply ) {
278
281
assert . strictEqual ( reply . length , 3 ) ;
282
+ assert . strictEqual ( reply [ 0 ] . code , 'ERR' ) ;
279
283
assert ( / ^ E R R / . test ( reply [ 0 ] . message ) , "Error message should begin with ERR" ) ;
280
284
assert ( / ^ E R R / . test ( reply [ 2 ] . message ) , "Error message should begin with ERR" ) ;
281
285
assert . strictEqual ( reply [ 1 ] , "OK" ) ;
0 commit comments