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

Make GrpcStatus implement GrpcExceptionHandlerFunction #5550

Closed
ikhoon opened this issue Apr 1, 2024 · 2 comments · Fixed by #5571
Closed

Make GrpcStatus implement GrpcExceptionHandlerFunction #5550

ikhoon opened this issue Apr 1, 2024 · 2 comments · Fixed by #5571
Labels
cleanup sprint Issues for OSS Sprint participants

Comments

@ikhoon
Copy link
Contributor

ikhoon commented Apr 1, 2024

Although we use GrpcStatus as the default implementation of GrpcExceptionHandlerFunction, it does not implement GrpcExceptionHandlerFunction.

It would be good to refactor GrpcStatus and rename it to DefaultGrpcExceptionHandlerFunction. Afterward, DefaultGrpcExceptionHandlerFunction can be set to GrpcServiceBuilder and GrpcClientBuilder as default values.

private GrpcExceptionHandlerFunction exceptionHandler;

private GrpcExceptionHandlerFunction exceptionHandler;

@ikhoon ikhoon added cleanup sprint Issues for OSS Sprint participants labels Apr 1, 2024
@trustin
Copy link
Member

trustin commented Apr 1, 2024

Maybe instead add asExceptionHandler()? It sounds somewhat unnatural for a status constant to be a function.

@trustin
Copy link
Member

trustin commented Apr 1, 2024

Actually, never mind. I should have read the details of this issue before writing a comment 😓

minwoox pushed a commit that referenced this issue May 20, 2024
Motivation:

- Closes #5550 

Modifications:

- `GrpcStatus` implements `GrpcExceptionHandlerFunction`
- Rename `GrpcStatus` to `DefaultGrpcExceptionHandlerFunction`

Result:

- Closes #5550
- GrpcClientBuilder uses `DefaultGrpcExceptionHandlerFunction` as default
- GrpcService can use `DefaultGrpcExceptionHandlerFunction` for its `exceptionHandler`

<!--
Visit this URL to learn more about how to write a pull request description:
https://armeria.dev/community/developer-guide#how-to-write-pull-request-description
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup sprint Issues for OSS Sprint participants
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants