Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ private io.grpc.Status convert(StatusCode code) {
case CONTRACT_CONTEXTUAL_ERROR:
case UNLOADABLE_FUNCTION:
case INVALID_FUNCTION:
case INVALID_ARGUMENT:
return io.grpc.Status.INVALID_ARGUMENT;
case CERTIFICATE_NOT_FOUND:
case CONTRACT_NOT_FOUND:
case ASSET_NOT_FOUND:
case FUNCTION_NOT_FOUND:
case SECRET_NOT_FOUND:
return io.grpc.Status.NOT_FOUND;
case CERTIFICATE_ALREADY_REGISTERED:
case SECRET_ALREADY_REGISTERED:
Comment on lines 130 to 142
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This switch statement is becoming quite long. With these additions, it's a good time to consider a future refactoring. Using a Map<StatusCode, io.grpc.Status> could make these mappings more declarative and improve maintainability as more status codes are added. This is a suggestion for future improvement and not a blocker for this PR.

Expand Down