reader = null;
}
if (reader != null) {
IParser parser = ct.newParser(getContext());
OperationOutcome outcome = parser.parseResource(OperationOutcome.class, reader);
retVal.setOperationOutcome(outcome);
}
} else {
ourLog.debug("Ignoring response content of type: {}", theResponseMimeType);
}
}
return retVal;
case Constants.STATUS_HTTP_400_BAD_REQUEST:
throw new InvalidRequestException("Server responded with: " + IOUtils.toString(theResponseReader));
case Constants.STATUS_HTTP_404_NOT_FOUND:
throw new ResourceNotFoundException("Server responded with: " + IOUtils.toString(theResponseReader));
case Constants.STATUS_HTTP_405_METHOD_NOT_ALLOWED:
throw new MethodNotAllowedException("Server responded with: " + IOUtils.toString(theResponseReader));
case Constants.STATUS_HTTP_409_CONFLICT:
throw new ResourceVersionConflictException("Server responded with: " + IOUtils.toString(theResponseReader));
case Constants.STATUS_HTTP_412_PRECONDITION_FAILED:
throw new ResourceVersionNotSpecifiedException("Server responded with: " + IOUtils.toString(theResponseReader));
case Constants.STATUS_HTTP_422_UNPROCESSABLE_ENTITY:
IParser parser = createAppropriateParser(theResponseMimeType, theResponseReader, theResponseStatusCode);
OperationOutcome operationOutcome = parser.parseResource(OperationOutcome.class, theResponseReader);
throw new UnprocessableEntityException(operationOutcome);
default:
throw new UnclassifiedServerFailureException(theResponseStatusCode, IOUtils.toString(theResponseReader));
}