Browse Source

Make some on connect errors user errors.

Issue 3111

Change-Id: Ieb8ca1c74cbe1e8fd9c9ba1ff4934fe3db1729c4
Reviewed-on: http://gerrit.dmdirc.com/86
Reviewed-by: Chris Smith <chris@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Shane Mc Cormack 14 years ago
parent
commit
c2748a8685
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      src/com/dmdirc/parser/irc/IRCParser.java

+ 7
- 6
src/com/dmdirc/parser/irc/IRCParser.java View File

763
      * Handle an onConnect error.
763
      * Handle an onConnect error.
764
      *
764
      *
765
      * @param e Exception to handle
765
      * @param e Exception to handle
766
+     * @param isUserError Is this a user error?
766
      */
767
      */
767
-    private void handleConnectException(final Exception e) {
768
+    private void handleConnectException(final Exception e, final boolean isUserError) {
768
         callDebugInfo(DEBUG_SOCKET, "Error Connecting (" + e.getMessage() + "), Aborted");
769
         callDebugInfo(DEBUG_SOCKET, "Error Connecting (" + e.getMessage() + "), Aborted");
769
-        final ParserError ei = new ParserError(ParserError.ERROR_ERROR, "Exception with server socket", getLastLine());
770
+        final ParserError ei = new ParserError(ParserError.ERROR_ERROR + (isUserError ? ParserError.ERROR_USER : 0), "Exception with server socket", getLastLine());
770
         ei.setException(e);
771
         ei.setException(e);
771
         callConnectError(ei);
772
         callConnectError(ei);
772
         
773
         
788
         try {
789
         try {
789
          connect();
790
          connect();
790
         } catch (UnknownHostException e) {
791
         } catch (UnknownHostException e) {
791
-            handleConnectException(e);
792
+            handleConnectException(e, true);
792
             return;
793
             return;
793
         } catch (IOException e) {
794
         } catch (IOException e) {
794
-            handleConnectException(e);
795
+            handleConnectException(e, true);
795
             return;
796
             return;
796
         } catch (NoSuchAlgorithmException e) {
797
         } catch (NoSuchAlgorithmException e) {
797
-            handleConnectException(e);
798
+            handleConnectException(e, false);
798
             return;
799
             return;
799
         } catch (KeyManagementException e) {
800
         } catch (KeyManagementException e) {
800
-            handleConnectException(e);
801
+            handleConnectException(e, false);
801
             return;
802
             return;
802
         }
803
         }
803
 
804
 

Loading…
Cancel
Save