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

Support custom JSON marshaller for error details in unframed grpc error #4723

Closed
cormoran opened this issue Mar 6, 2023 · 1 comment · Fixed by #5555
Closed

Support custom JSON marshaller for error details in unframed grpc error #4723

cormoran opened this issue Mar 6, 2023 · 1 comment · Fixed by #5555
Labels
new feature sprint Issues for OSS Sprint participants

Comments

@cormoran
Copy link
Contributor

cormoran commented Mar 6, 2023

In short, implements this TODO comment.

When using grpc richer error response, we sometimes want to pass custom type in Status.details instead of well-known details.
Now it fails for unframed http transcoding requests since the error marshaller doesn't know custom types and there is no way to register custom types.

@ikhoon
Copy link
Contributor

ikhoon commented Mar 9, 2023

It is time to add a builder class to create UnframedGrpcErrorHandler with various options.
For example:

UnframedGrpcErrorHandler.builder()
                        .responseType(UnframedGrpcErrorResponseType.JSON,
                                      UnframedGrpcErrorResponseType.PLAINTEXT)
                        .statusFunction(UnframedGrpcStatusMappingFunction)
                        .jsonMarshaller(MessageMarshaller)
                        .build()

@jrhee17 jrhee17 added the sprint Issues for OSS Sprint participants label Apr 1, 2024
ikhoon pushed a commit that referenced this issue Apr 17, 2024
Motivation:

- A user can't use custom JSON marshaller for unframed grpc error.

Modifications:

- Implement `UnframedGrpcErrorHandlerBuilder` which takes a custom json
marshaller

Result:

- Closes #4723.
- A user can use their custom JSON marshaller for unframed grpc error.
Dogacel pushed a commit to Dogacel/armeria that referenced this issue Jun 8, 2024
Motivation:

- A user can't use custom JSON marshaller for unframed grpc error.

Modifications:

- Implement `UnframedGrpcErrorHandlerBuilder` which takes a custom json
marshaller

Result:

- Closes line#4723.
- A user can use their custom JSON marshaller for unframed grpc error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature sprint Issues for OSS Sprint participants
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants