From 6d9dda942e9b67ba071692171eada271a82a8ffc Mon Sep 17 00:00:00 2001 From: Roey Berman Date: Sun, 20 Oct 2024 14:13:28 -0700 Subject: [PATCH] Translate gRPC Canceled code to Nexus HandlerErrorTypeInternal --- internal/internal_nexus_task_handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/internal_nexus_task_handler.go b/internal/internal_nexus_task_handler.go index 7134012e2..3388d4c17 100644 --- a/internal/internal_nexus_task_handler.go +++ b/internal/internal_nexus_task_handler.go @@ -462,11 +462,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.