case XML:
case JSON:
final ODataErrorContext errorContext = EntityProvider.readErrorDocument(
response.getEntity().getContent(),
responseContentType.toString());
throw new ODataApplicationException(errorContext.getMessage(),
errorContext.getLocale(), httpStatusCode, errorContext.getErrorCode(),
errorContext.getException());
default:
// fall through to default exception with status line information
}
} catch (EntityProviderException e) {
throw new ODataApplicationException(e.getMessage(), response.getLocale(), httpStatusCode, e);
} catch (IOException e) {
throw new ODataApplicationException(e.getMessage(), response.getLocale(), httpStatusCode, e);
}
}
throw new ODataApplicationException(statusLine.getReasonPhrase(), response.getLocale(), httpStatusCode);
}
return httpStatusCode;
}