@@ -254,15 +254,19 @@ describe("The 'multi' method", function () {
254254 assert ( err . message . match ( / ^ E X E C A B O R T / ) , "Error message should begin with EXECABORT" ) ;
255255 assert . equal ( err . errors . length , 2 , "err.errors should have 2 items" ) ;
256256 assert . strictEqual ( err . errors [ 0 ] . command_used , 'SET' ) ;
257+ assert . strictEqual ( err . errors [ 0 ] . code , 'ERR' ) ;
257258 assert . strictEqual ( err . errors [ 0 ] . position , 1 ) ;
258259 assert ( / ^ E R R / . test ( err . errors [ 0 ] . message ) , "Actuall error message should begin with ERR" ) ;
259260 return done ( ) ;
260261 } ) ;
261262 } ) ;
262263
263264 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 ) ;
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 ) ) ;
266270 assert ( / ^ E R R / . test ( reply [ 0 ] . message ) , "Error message should begin with ERR" ) ;
267271 assert ( / ^ E R R / . test ( reply [ 1 ] . message ) , "Error message should begin with ERR" ) ;
268272 return done ( ) ;
@@ -275,6 +279,7 @@ describe("The 'multi' method", function () {
275279 multi . set ( 'foo' , 'bar' , helper . isString ( 'OK' ) ) ;
276280 multi . debug ( "foo" ) . exec ( function ( err , reply ) {
277281 assert . strictEqual ( reply . length , 3 ) ;
282+ assert . strictEqual ( reply [ 0 ] . code , 'ERR' ) ;
278283 assert ( / ^ E R R / . test ( reply [ 0 ] . message ) , "Error message should begin with ERR" ) ;
279284 assert ( / ^ E R R / . test ( reply [ 2 ] . message ) , "Error message should begin with ERR" ) ;
280285 assert . strictEqual ( reply [ 1 ] , "OK" ) ;
0 commit comments