* @return {@link CDAArray} result.
* @throws retrofit.RetrofitError in case of an error.
*/
private CDAArray fetchArrayWithTypeBlocking(String type, Map<String, String> query) throws RetrofitError {
ensureSpaceBlocking(false);
Response response = service.fetchArrayWithTypeBlocking(spaceKey, type, query);
CDAArray result;
try {
result = gson.fromJson(new InputStreamReader(response.getBody().in()), CDAArray.class);
ArrayResponse.prepareResponse(result, response);
} catch (IOException e) {
throw RetrofitError.unexpectedError(response.getUrl(), e);
}
return result;
}