Skip to content

[KW-480] feat: http error code grpc runtime status error로 변경#31

Merged
coffeesigma merged 3 commits intodevelopfrom
KW-480/feat/hospital-service-grpc-error-util-생성
May 28, 2025

Hidden character warning

The head ref may contain hidden characters: "KW-480/feat/hospital-service-grpc-error-util-\uc0dd\uc131"
Merged

[KW-480] feat: http error code grpc runtime status error로 변경#31
coffeesigma merged 3 commits intodevelopfrom
KW-480/feat/hospital-service-grpc-error-util-생성

Conversation

@coffeesigma
Copy link
Contributor

@coffeesigma coffeesigma commented May 27, 2025

🔷 Jira Ticket ID

KW-480


📌 작업 내용 및 특이사항

  • gRPC 에러 표현할 수 있는 util class 생성
  • gRPC server 로직에서 변경하여 에러 처리

📚 참고사항

@github-actions github-actions bot changed the title feat: http error code grpc runtime status error로 변경 [KW-480] feat: http error code grpc runtime status error로 변경 May 27, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Contributor

@willjsw willjsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@coffeesigma coffeesigma merged commit 275f414 into develop May 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants