[KW-480] feat: http error code grpc runtime status error로 변경#31
Merged
coffeesigma merged 3 commits intodevelopfrom May 28, 2025
Hidden character warning
The head ref may contain hidden characters: "KW-480/feat/hospital-service-grpc-error-util-\uc0dd\uc131"
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a gRPC error handling utility and updates service implementations to use this new exception handling approach.
- Added GrpcExceptionUtil to convert BaseErrorCode to StatusRuntimeException with metadata.
- Replaced CommonException usage with GrpcExceptionUtil in BuildingGrpcServiceImpl and AreaGrpcServiceImpl for consistent error handling.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/com/doubleo/hospitalservice/global/exception/GrpcExceptionUtil.java | New utility for converting error codes to gRPC exceptions with metadata. |
| src/main/java/com/doubleo/hospitalservice/domain/building/grpc/server/BuildingGrpcServiceImpl.java | Updated error handling to use GrpcExceptionUtil for BUILDING_NOT_FOUND. |
| src/main/java/com/doubleo/hospitalservice/domain/area/grpc/server/AreaGrpcServiceImpl.java | Replaced CommonException with GrpcExceptionUtil for AREA_NOT_FOUND and BUILDING_NOT_FOUND scenarios. |
Comments suppressed due to low confidence (1)
src/main/java/com/doubleo/hospitalservice/global/exception/GrpcExceptionUtil.java:8
- Add unit tests for the GrpcExceptionUtil to verify that the error code properties are correctly translated into gRPC metadata and status.
public class GrpcExceptionUtil {
src/main/java/com/doubleo/hospitalservice/global/exception/GrpcExceptionUtil.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔷 Jira Ticket ID
KW-480
📌 작업 내용 및 특이사항
📚 참고사항