Avoid to change network with 421
This commit is contained in:
parent
485cf33af2
commit
9d37f34835
|
@ -782,10 +782,16 @@ public class API {
|
||||||
} catch (NoSuchAlgorithmException | KeyManagementException | JSONException e1) {
|
} catch (NoSuchAlgorithmException | KeyManagementException | JSONException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
} catch (HttpsConnection.HttpsConnectionException e1) {
|
} catch (HttpsConnection.HttpsConnectionException e1) {
|
||||||
instanceNodeInfo.setName("GNU");
|
if( e1.getStatusCode() == 404) {
|
||||||
instanceNodeInfo.setVersion("unknown");
|
instanceNodeInfo.setName("GNU");
|
||||||
instanceNodeInfo.setOpenRegistrations(true);
|
instanceNodeInfo.setVersion("unknown");
|
||||||
e1.printStackTrace();
|
instanceNodeInfo.setOpenRegistrations(true);
|
||||||
|
e1.printStackTrace();
|
||||||
|
}else{
|
||||||
|
instanceNodeInfo.setName("MASTODON");
|
||||||
|
instanceNodeInfo.setVersion("3.0");
|
||||||
|
instanceNodeInfo.setOpenRegistrations(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -826,11 +832,7 @@ public class API {
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
setDefaultError(e);
|
setDefaultError(e);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException | JSONException | NoSuchAlgorithmException | KeyManagementException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (KeyManagementException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
try {
|
try {
|
||||||
|
@ -842,20 +844,21 @@ public class API {
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
instanceNodeInfo.setConnectionError(true);
|
instanceNodeInfo.setConnectionError(true);
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
} catch (NoSuchAlgorithmException e1) {
|
} catch (NoSuchAlgorithmException | JSONException | KeyManagementException e1) {
|
||||||
e1.printStackTrace();
|
|
||||||
} catch (KeyManagementException e1) {
|
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
} catch (HttpsConnection.HttpsConnectionException e1) {
|
} catch (HttpsConnection.HttpsConnectionException e1) {
|
||||||
instanceNodeInfo.setName("GNU");
|
if( e1.getStatusCode() == 404) {
|
||||||
instanceNodeInfo.setVersion("unknown");
|
instanceNodeInfo.setName("GNU");
|
||||||
instanceNodeInfo.setOpenRegistrations(true);
|
instanceNodeInfo.setVersion("unknown");
|
||||||
} catch (JSONException e1) {
|
instanceNodeInfo.setOpenRegistrations(true);
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
|
}else{
|
||||||
|
instanceNodeInfo.setName("MASTODON");
|
||||||
|
instanceNodeInfo.setVersion("3.0");
|
||||||
|
instanceNodeInfo.setOpenRegistrations(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return instanceNodeInfo;
|
return instanceNodeInfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue