List<BVError> responseErrors = new ArrayList<BVError>();
JSONArray errors = json.getJSONArray(BVConstants.JSON_ERRORS.toString());
int numberOfErrors = errors.length();
for (int i = 0; i < numberOfErrors; i++) {
JSONObject error = errors.getJSONObject(i);
BVError responseError = new BVError();
responseError.setCode(error.getString(BVConstants.JSON_CODE.toString()));
responseError.setMessage(error.getString(BVConstants.JSON_MESSAGE.toString()));
responseErrors.add(responseError);
}
elementToUpdate.setErrors(responseErrors);
} catch (JSONException e) {
logJSONException(BVConstants.JSON_ERRORS.toString(), e);