File tree 1 file changed +4
-3
lines changed
src/main/java/com/github/shyiko/mysql/binlog
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -495,8 +495,9 @@ public void setThreadFactory(ThreadFactory threadFactory) {
495
495
* @throws AuthenticationException if authentication fails
496
496
* @throws ServerException if MySQL server responds with an error
497
497
* @throws IOException if anything goes wrong while trying to connect
498
+ * @throws IllegalStateException if binary log client is already connected
498
499
*/
499
- public void connect () throws IOException {
500
+ public void connect () throws IOException , IllegalStateException {
500
501
if (!connectLock .tryLock ()) {
501
502
throw new IllegalStateException ("BinaryLogClient is already connected" );
502
503
}
@@ -836,8 +837,8 @@ public void run() {
836
837
try {
837
838
setConnectTimeout (timeout );
838
839
connect ();
839
- } catch (IOException e ) {
840
- exceptionReference .set (e );
840
+ } catch (Exception e ) {
841
+ exceptionReference .set (new IOException ( e )); // method is asynchronous, catch all exceptions so that they are not lost
841
842
countDownLatch .countDown (); // making sure we don't end up waiting whole "timeout"
842
843
}
843
844
}
You can’t perform that action at this time.
0 commit comments