Fixed invalid servers in placeholders throwing an error instead of just saying the server is invalid
This commit is contained in:
@@ -121,6 +121,7 @@ public class SpigotAPI extends AjQueueSpigotAPI {
|
|||||||
String responseString = response.getResponse();
|
String responseString = response.getResponse();
|
||||||
if(responseString.equals("invalid_server")) {
|
if(responseString.equals("invalid_server")) {
|
||||||
future.completeExceptionally(new IllegalArgumentException(queueName + " does not exist!"));
|
future.completeExceptionally(new IllegalArgumentException(queueName + " does not exist!"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
future.complete(Integer.valueOf(responseString));
|
future.complete(Integer.valueOf(responseString));
|
||||||
});
|
});
|
||||||
@@ -148,6 +149,7 @@ public class SpigotAPI extends AjQueueSpigotAPI {
|
|||||||
String responseString = response.getResponse();
|
String responseString = response.getResponse();
|
||||||
if(responseString.equals("invalid_server")) {
|
if(responseString.equals("invalid_server")) {
|
||||||
future.completeExceptionally(new IllegalArgumentException(queueName + " does not exist!"));
|
future.completeExceptionally(new IllegalArgumentException(queueName + " does not exist!"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
future.complete(responseString);
|
future.complete(responseString);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user