File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -302,11 +302,7 @@ RedisClient.prototype.init_parser = function () {
302
302
303
303
// "reply error" is an error sent back by Redis
304
304
this . reply_parser . on ( "reply error" , function ( reply ) {
305
- if ( reply instanceof Error ) {
306
- self . return_error ( reply ) ;
307
- } else {
308
- self . return_error ( new Error ( reply ) ) ;
309
- }
305
+ self . return_error ( reply ) ;
310
306
} ) ;
311
307
this . reply_parser . on ( "reply" , function ( reply ) {
312
308
self . return_reply ( reply ) ;
@@ -654,7 +650,9 @@ RedisClient.prototype.return_reply = function (reply) {
654
650
}
655
651
656
652
try_callback ( command_obj . callback , reply ) ;
657
- } else debug ( "no callback for reply: " + ( reply && reply . toString && reply . toString ( ) ) ) ;
653
+ } else {
654
+ debug ( "no callback for reply: " + ( reply && reply . toString && reply . toString ( ) ) ) ;
655
+ }
658
656
} else if ( this . pub_sub_mode || ( command_obj && command_obj . sub_command ) ) {
659
657
if ( Array . isArray ( reply ) ) {
660
658
type = reply [ 0 ] . toString ( ) ;
Original file line number Diff line number Diff line change @@ -177,8 +177,7 @@ ReplyParser.prototype.execute = function (buffer) {
177
177
if ( ret === null ) {
178
178
break ;
179
179
}
180
-
181
- this . send_error ( ret ) ;
180
+ this . send_error ( new Error ( ret ) ) ;
182
181
} else if ( type === 58 ) { // :
183
182
ret = this . _parseResult ( type ) ;
184
183
You can’t perform that action at this time.
0 commit comments