@@ -66,7 +66,8 @@ private enum ExceptionType{
66
66
ET_NOINITIALIZED (4 ),
67
67
ET_NOTLEADER (5 ),
68
68
ET_READTIMEDOUT (6 ),
69
- ET_NORESPONSEHEADER (7 );
69
+ ET_NORESPONSEHEADER (7 ),
70
+ ET_LOGINREQUIRED (8 );
70
71
71
72
public int value ;
72
73
ExceptionType (int value ){
@@ -1113,6 +1114,9 @@ public ExceptionType parseException(String msg, Node node) {
1113
1114
} else if (msg .contains ("Failed to read response header from the socket with IO error null" )) {
1114
1115
conn_ .getNode (node );
1115
1116
return ExceptionType .ET_NORESPONSEHEADER ;
1117
+ } else if (msg .contains ("Login is required for script execution with client authentication enabled" )) {
1118
+ conn_ .getNode (node );
1119
+ return ExceptionType .ET_LOGINREQUIRED ;
1116
1120
} else {
1117
1121
node .hostName = "" ;
1118
1122
node .port = 0 ;
@@ -1131,8 +1135,8 @@ public void parseIpPort(String ipport, Node node){
1131
1135
1132
1136
public boolean connected (){
1133
1137
try {
1134
- BasicInt ret = ( BasicInt ) conn_ .run ("1+1" , 0 );
1135
- return ! ret . isNull () && ( ret . getInt () == 2 ) ;
1138
+ conn_ .run ("version" , new ArrayList <>(), 0 );
1139
+ return true ;
1136
1140
}catch (Exception e ){
1137
1141
return false ;
1138
1142
}
@@ -1253,7 +1257,7 @@ public Entity run(String script, ProgressListener listener, int priority, int pa
1253
1257
ExceptionType type = parseException (e .getMessage (), node );
1254
1258
if (type == ExceptionType .ET_IGNORE )
1255
1259
return new Void ();
1256
- else if (type == ExceptionType .ET_UNKNOW )
1260
+ else if (type == ExceptionType .ET_UNKNOW || type == ExceptionType . ET_LOGINREQUIRED )
1257
1261
throw e ;
1258
1262
else if (type == ExceptionType .ET_READTIMEDOUT )
1259
1263
cancelConsoleJob (enableSeqNo , currentSeqNo , e );
0 commit comments