File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -978,6 +978,8 @@ RedisClient.prototype.select = function (db, callback) {
978
978
}
979
979
if ( typeof ( callback ) === 'function' ) {
980
980
callback ( err , res ) ;
981
+ } else if ( err ) {
982
+ self . emit ( 'error' , err ) ;
981
983
}
982
984
} ) ;
983
985
} ;
Original file line number Diff line number Diff line change @@ -865,6 +865,16 @@ tests.reconnect_select_db_after_pubsub = function() {
865
865
} ) ;
866
866
} ;
867
867
868
+ tests . select_error_emits_if_no_callback = function ( ) {
869
+ var name = "select_error_emits_if_no_callback" ;
870
+
871
+ client . on ( 'error' , with_timeout ( name , function ( err ) {
872
+ require_error ( name ) ( err ) ;
873
+ next ( name ) ;
874
+ } , 500 ) ) ;
875
+ client . select ( 9999 ) ;
876
+ } ;
877
+
868
878
tests . idle = function ( ) {
869
879
var name = "idle" ;
870
880
You can’t perform that action at this time.
0 commit comments