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,15 +404,11 @@ public abstract class BaseAPI
try try
{ {
String bodyString = EntityUtils.toString(response.getEntity()); responseBody = new JSONObject(EntityUtils.toString(response.getEntity()));
try }
{ catch (JSONException error)
responseBody = new JSONObject(bodyString); {
} LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
catch (JSONException error)
{
LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error);
}
} }
catch (ParseException | IOException error) catch (ParseException | IOException error)
{ {