소스 검색

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 년 전
부모
커밋
c2748a8685
1개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 7
    6
      src/com/dmdirc/parser/irc/IRCParser.java

+ 7
- 6
src/com/dmdirc/parser/irc/IRCParser.java 파일 보기

@@ -763,10 +763,11 @@ public class IRCParser implements SecureParser, Runnable {
763 763
      * Handle an onConnect error.
764 764
      *
765 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 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 771
         ei.setException(e);
771 772
         callConnectError(ei);
772 773
         
@@ -788,16 +789,16 @@ public class IRCParser implements SecureParser, Runnable {
788 789
         try {
789 790
          connect();
790 791
         } catch (UnknownHostException e) {
791
-            handleConnectException(e);
792
+            handleConnectException(e, true);
792 793
             return;
793 794
         } catch (IOException e) {
794
-            handleConnectException(e);
795
+            handleConnectException(e, true);
795 796
             return;
796 797
         } catch (NoSuchAlgorithmException e) {
797
-            handleConnectException(e);
798
+            handleConnectException(e, false);
798 799
             return;
799 800
         } catch (KeyManagementException e) {
800
-            handleConnectException(e);
801
+            handleConnectException(e, false);
801 802
             return;
802 803
         }
803 804
 

Loading…
취소
저장