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

Clearer error reporting from request handlers #75

Open
brandoniles opened this issue Sep 21, 2015 · 0 comments
Open

Clearer error reporting from request handlers #75

brandoniles opened this issue Sep 21, 2015 · 0 comments
Assignees
Labels

Comments

@brandoniles
Copy link

Throwing exceptions "across the wire" is probably not the best error reporting strategy, but it would be nice to have some cleaner answer for this.

Right now the client handler code needs to do something like:

if (value == null) {
    err = new NotFoundError(key);
}
return new Response.Builder<>(new KeyValue.getValue_result(value, err), request.getEndpoint(), ResponseCode.OK) ...

Clients have to set the response code in parallel to the error in the response. It's also unclear whether the value is transmitted along with err when err is non-null (I think it's not). Some applications may have a partial response that can be used in addition to the reported error.

@brandoniles brandoniles changed the title Allow request handlers to throw thrift exceptions Clearer error reporting from request handlers Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants