import java.util.ArrayList;
import java.util.List;
+import javax.net.ssl.SSLException;
+
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
new ConnectActionClientObject(host, port, key) {
@Override
public void action(Version serverVersion) throws Exception {
- try {
- Object rep = send(new Object[] { "PING" });
+ Object rep = send(new Object[] { "PING" });
- if ("PONG".equals(rep)) {
- result[0] = Status.READY;
- } else {
- result[0] = Status.UNAUTORIZED;
- }
- } catch (IllegalArgumentException e) {
+ if ("PONG".equals(rep)) {
+ result[0] = Status.READY;
+ } else {
result[0] = Status.UNAUTORIZED;
}
}
@Override
protected void onError(Exception e) {
- result[0] = Status.UNAVAILABLE;
+ if (e instanceof SSLException) {
+ result[0] = Status.UNAUTORIZED;
+ } else {
+ result[0] = Status.UNAVAILABLE;
+ }
}
}.connect();
} catch (UnknownHostException e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (Exception e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (Exception e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (Exception e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
}
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (IOException e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (IOException e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (IOException e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (IOException e) {
@Override
protected void onError(Exception e) {
- Instance.getTraceHandler().error(e);
+ if (e instanceof SSLException) {
+ Instance.getTraceHandler().error(
+ "Connection refused (bad key)");
+ } else {
+ Instance.getTraceHandler().error(e);
+ }
}
}.connect();
} catch (Exception e) {