Skip to content

Support for com.google.rpc.Status ? #381

Answered by benallard
benallard asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, this is what I ended up with:

    @GRpcExceptionHandler
    public Status handle(MessageException aExc, GRpcExceptionScope aScope) {
        log.error("Exception processing in method {}", aScope.getMethodDescriptor().getFullMethodName());
        ErrorInfo.Builder builder = ErrorInfo.newBuilder()
                .setDomain(itsDomain)
                .setReason(aExc.getReason());
        for (Map.Entry<String, String> entry : aExc.getExtraData().entrySet()) {
            builder.putMetadata(entry.getKey(), entry.getValue());
        }
        com.google.rpc.Status status = com.google.rpc.Status.newBuilder()
                .setCode(aExc.getStatus().getCode().value())
                .s…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@benallard
Comment options

@jvmlet
Comment options

@benallard
Comment options

@benallard
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by benallard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants