RM-5611 Code review fixes.

Remove nested try catch. Add additional check that we don't have duplicate
topics selected.
This commit is contained in:
Tom Page
2017-09-08 14:10:47 +01:00
parent b2ac4f89ee
commit d8f16a990c

View File

@@ -404,16 +404,12 @@ public abstract class BaseAPI
try try
{ {
String bodyString = EntityUtils.toString(response.getEntity()); responseBody = new JSONObject(EntityUtils.toString(response.getEntity()));
try
{
responseBody = new JSONObject(bodyString);
} }
catch (JSONException error) catch (JSONException error)
{ {
LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
} }
}
catch (ParseException | IOException error) catch (ParseException | IOException error)
{ {
LOGGER.error("Parsing message body failed.", error); LOGGER.error("Parsing message body failed.", error);