Skip to content

Commit

Permalink
Translate gRPC Canceled code to Nexus HandlerErrorTypeInternal (#1680)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergundy authored Oct 25, 2024
1 parent 5505d04 commit c0a1b59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/internal_nexus_task_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,11 @@ func convertServiceError(err error) error {
errMessage := err.Error()

switch st.Code() {
case codes.AlreadyExists, codes.Canceled, codes.InvalidArgument, codes.FailedPrecondition, codes.OutOfRange:
case codes.AlreadyExists, codes.InvalidArgument, codes.FailedPrecondition, codes.OutOfRange:
return nexus.HandlerErrorf(nexus.HandlerErrorTypeBadRequest, errMessage)
case codes.Aborted, codes.Unavailable:
return nexus.HandlerErrorf(nexus.HandlerErrorTypeUnavailable, errMessage)
case codes.DataLoss, codes.Internal, codes.Unknown, codes.Unauthenticated, codes.PermissionDenied:
case codes.Canceled, codes.DataLoss, codes.Internal, codes.Unknown, codes.Unauthenticated, codes.PermissionDenied:
// Note that codes.Unauthenticated, codes.PermissionDenied have Nexus error types but we convert to internal
// because this is not a client auth error and happens when the handler fails to auth with Temporal and should
// be considered retryable.
Expand Down

0 comments on commit c0a1b59

Please sign in to comment.