Project

General

Profile

« Previous | Next » 

Revision c29cc6f1

Added by Andreas Kohlbecker about 4 years ago

ref #8844 specific message in case of SockeTimeoutExceptions

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java
10 10

  
11 11
import java.io.File;
12 12
import java.io.IOException;
13
import java.net.SocketTimeoutException;
13 14
import java.text.SimpleDateFormat;
14 15
import java.util.Date;
15 16
import java.util.HashMap;
......
610 611
                    }
611 612
                } catch (CDMServerException | IOException e) {
612 613
                    txtCdmServerStatus.setText(STATUS_NOT_AVAILABLE);
614
                    // TODO distinguish java.net.ConnectException: Connection refused, java.net.SocketTimeoutException: Read timed out
615
                    Throwable cause = e;
616
                    if(e instanceof CDMServerException && e.getCause() != null){
617
                        cause = e.getCause();
618
                    }
619
                    String message = Messages.RemotingLoginDialog_CONNECTION_FAILED_MESSAGE;
620
                    if(cause instanceof SocketTimeoutException){
621
                        message = Messages.RemotingLoginDialog_CONNECTION_TIMEOUT_MESSAGE;
622
                    }
613 623
                    MessagingUtils.warningDialog(Messages.RemotingLoginDialog_CONNECTION_FAILED_TITLE, this,
614
                            Messages.RemotingLoginDialog_CONNECTION_FAILED_MESSAGE);
624
                            message);
615 625
                    logger.warn(Messages.RemotingLoginDialog_CONNECTION_FAILED_TITLE, e);
616 626
                }
617 627
            }

Also available in: Unified diff