http-api: Use observables for world api

This commit is contained in:
Owain van Brakel
2019-07-19 05:00:39 +02:00
parent 60d734549f
commit 1cddf12a2c
3 changed files with 53 additions and 48 deletions

View File

@@ -61,7 +61,7 @@ public class WorldClient
if (!response.isSuccessful())
{
logger.debug("Error looking up worlds: {}", response);
return null;
return Observable.just(null);
}
InputStream in = response.body().byteStream();
@@ -69,7 +69,7 @@ public class WorldClient
}
catch (JsonParseException ex)
{
throw new IOException(ex);
return Observable.error(ex);
}
});
}