@@ -140,7 +140,6 @@ sub new {
140
140
$self -> {handle_params } = $params {handle_params } || {};
141
141
$self -> {on_connect } = $params {on_connect };
142
142
$self -> {on_disconnect } = $params {on_disconnect };
143
- $self -> {on_connect_error } = $params {on_connect_error };
144
143
145
144
$self -> connection_timeout( $params {connection_timeout } );
146
145
$self -> read_timeout( $params {read_timeout } );
@@ -232,9 +231,7 @@ sub on_error {
232
231
};
233
232
}
234
233
235
- foreach my $name ( qw( utf8 reconnect on_connect on_disconnect
236
- on_connect_error ) )
237
- {
234
+ foreach my $name ( qw( utf8 reconnect on_connect on_disconnect ) ) {
238
235
*{$name } = sub {
239
236
my $self = shift ;
240
237
@@ -962,12 +959,7 @@ sub _abort {
962
959
my $err_msg = $err -> message;
963
960
my $err_code = $err -> code;
964
961
965
- if ( defined $self -> {on_connect_error } && $err_code == E_CANT_CONN ) {
966
- $self -> {on_connect_error }-> ($err );
967
- }
968
- else {
969
- $self -> {on_error }-> ($err );
970
- }
962
+ $self -> {on_error }-> ($err );
971
963
972
964
if ( %channels && $err_code != E_CONN_CLOSED_BY_CLIENT ) {
973
965
foreach my $name ( keys %channels ) {
@@ -1124,12 +1116,6 @@ Requires Redis 1.2 or higher, and any supported event loop.
1124
1116
# handling...
1125
1117
},
1126
1118
1127
- on_connect_error => sub {
1128
- my $err = shift;
1129
-
1130
- # error handling...
1131
- },
1132
-
1133
1119
on_error => sub {
1134
1120
my $err = shift;
1135
1121
@@ -1171,9 +1157,9 @@ Enabled by default.
1171
1157
=item connection_timeout => $fractional_seconds
1172
1158
1173
1159
Specifies connection timeout. If the client could not connect to the server
1174
- after specified timeout, the C<on_connect_error > callback is called with the
1175
- C<E_CANT_CONN > error, or if it not specified, the C< on_error > callback is
1176
- called. The timeout specifies in seconds and can contain a fractional part.
1160
+ after specified timeout, the C<on_error > callback is called with the
1161
+ C<E_CANT_CONN > error. The timeout specifies in seconds and can contain a
1162
+ fractional part.
1177
1163
1178
1164
connection_timeout => 10.5,
1179
1165
@@ -1244,18 +1230,10 @@ reason.
1244
1230
1245
1231
Not set by default.
1246
1232
1247
- =item on_connect_error => $cb->( $err )
1248
-
1249
- The C<on_connect_error > callback is called, when the connection could not be
1250
- established. If this callback isn't specified, the C<on_error > callback is
1251
- called.
1252
-
1253
- Not set by default.
1254
-
1255
1233
=item on_error => $cb->( $err )
1256
1234
1257
1235
The C<on_error > callback is called when occurred an error, which was affected
1258
- on whole client (e. g. connection error or authentication error). Also the
1236
+ on entire client (e. g. connection error or authentication error). Also the
1259
1237
C<on_error > callback is called on command errors if the command callback is not
1260
1238
specified. If the C<on_error > callback is not specified, the client just print
1261
1239
an error messages to C<STDERR > .
@@ -1859,10 +1837,6 @@ Get or set the C<on_connect> callback.
1859
1837
1860
1838
Get or set the C<on_disconnect > callback.
1861
1839
1862
- =head2 on_connect_error( [ $callback ] )
1863
-
1864
- Get or set the C<on_connect_error > callback.
1865
-
1866
1840
=head2 on_error( [ $callback ] )
1867
1841
1868
1842
Get or set the C<on_error > callback.
0 commit comments