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

Executing Rest API throws a generic RuntimeException - Need more details #46

Closed
AnirudhVyas opened this issue May 23, 2013 · 2 comments
Closed

Comments

@AnirudhVyas
Copy link

When the result of an operation is neither OK or CREATED, a plain RuntimeException with user inputs is thrown - as opposed to RequestResult's details:

if (result.statusIs(Response.Status.CREATED) || result.statusIs(Response.Status.OK)) {
return (RestRelationship)createExtractor().convertFromRepresentation(result);
}
throw new RuntimeException(String.format("Error retrieving or creating relationship for key %s and value %s with index %s", key, value, index.getIndexName()));

Propose to add client response and other details to runtime exception so that rest api java users can figure out whats going on.

@jexp
Copy link
Member

jexp commented May 24, 2013

Thanks for reporting it, feel free to issue a pull request.

Cheers

@AnirudhVyas
Copy link
Author

Did thanks. please review and approve (or suggest if anything else's better).

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

2 participants