Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openstack client does not throw exceptions on void operations with jersey connector #163

Open
tokle opened this issue Aug 13, 2014 · 0 comments

Comments

@tokle
Copy link

tokle commented Aug 13, 2014

When using the jersey connector the openstack client does not throw exceptions on errors from the backend when the operation has a void return type.
E.g: deleting a node will return ok from the nova client even if the backend operation fails with a 401 Unathorized. The problematic code is in the OpenStackClient:

public <T> T execute(OpenStackRequest<T> request) {
    OpenStackResponse response =  request(request);
    return (request.returnType() != null && request.returnType() != Void.class) ? response.getEntity(request.returnType()) : null;
}

The last line of the execute method will return null regardless of having a non-ok status code. If the return type is not void, the response.getEntity method will throw an exception in case of a non ok status code (at least this is true in the case of the jersey connector).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant