world client: always return non null or throw an error

This commit is contained in:
Adam
2019-11-23 16:52:09 -05:00
parent 643a77ad26
commit 6f5a719cfb
3 changed files with 5 additions and 16 deletions

View File

@@ -67,7 +67,7 @@ public class WorldClient
if (!response.isSuccessful())
{
logger.debug("Error looking up worlds: {}", response);
return null;
throw new IOException("unsuccessful response looking up worlds");
}
InputStream in = response.body().byteStream();

View File

@@ -119,13 +119,6 @@ public class DefaultWorldPlugin extends Plugin
try
{
final WorldResult worldResult = worldClient.lookupWorlds();
if (worldResult == null)
{
log.warn("Failed to lookup worlds.");
return;
}
final World world = worldResult.findWorld(correctedWorld);
if (world != null)

View File

@@ -514,14 +514,10 @@ public class WorldHopperPlugin extends Plugin
try
{
WorldResult worldResult = worldClient.lookupWorlds();
if (worldResult != null)
{
worldResult.getWorlds().sort(Comparator.comparingInt(World::getId));
this.worldResult = worldResult;
this.lastFetch = Instant.now();
updateList();
}
worldResult.getWorlds().sort(Comparator.comparingInt(World::getId));
this.worldResult = worldResult;
this.lastFetch = Instant.now();
updateList();
}
catch (IOException ex)
{