use of org.entando.entando.aps.system.services.api.model.ApiError in project entando-core by entando.
the class SelfRestCaller method extractResponseStatusCode.
protected Response.Status extractResponseStatusCode(Object responseObject) {
if (responseObject instanceof AbstractApiResponse) {
Response.Status status = Response.Status.OK;
AbstractApiResponse mainResponse = (AbstractApiResponse) responseObject;
if (null != mainResponse.getErrors()) {
for (int i = 0; i < mainResponse.getErrors().size(); i++) {
ApiError error = mainResponse.getErrors().get(i);
Response.Status errorStatus = error.getStatus();
if (null != errorStatus && status.getStatusCode() < errorStatus.getStatusCode()) {
status = errorStatus;
}
}
}
return status;
} else {
return Response.Status.OK;
}
}
Aggregations