From 6cc984e4e449a76b9332cf42603119ffd7633162 Mon Sep 17 00:00:00 2001 From: Jim Date: Sun, 23 Apr 2023 15:39:51 -0400 Subject: [PATCH] feat (errors): add WorkerFoundForRequest error code --- internal/errors/code.go | 2 ++ internal/errors/code_test.go | 5 +++++ internal/errors/info.go | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/internal/errors/code.go b/internal/errors/code.go index f0aee9d74..bf7f53a51 100644 --- a/internal/errors/code.go +++ b/internal/errors/code.go @@ -63,6 +63,8 @@ const ( StorageContainerReadOnly = 131 // StorageContainerReadOnly represents an error when a container is readonly and a write operation is attempted on it StorageContainerWriteOnly = 132 // StorageContainerWriteOnly represents an error when a container is write only and a read operation is attempted on it + WorkerNotFoundForRequest = 133 // WorkerNotFoundForRequest represents an error when no appropriate worker is found which meets the conditions required to handle a request + AuthAttemptExpired Code = 198 // AuthAttemptExpired represents an expired authentication attempt AuthMethodInactive Code = 199 // AuthMethodInactive represents an error that means the auth method is not active. diff --git a/internal/errors/code_test.go b/internal/errors/code_test.go index e2d40471f..3c3e75f36 100644 --- a/internal/errors/code_test.go +++ b/internal/errors/code_test.go @@ -390,6 +390,11 @@ func TestCode_Both_String_Info(t *testing.T) { c: StorageContainerWriteOnly, want: StorageContainerWriteOnly, }, + { + name: "WorkerNotFoundForRequest", + c: WorkerNotFoundForRequest, + want: WorkerNotFoundForRequest, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/internal/errors/info.go b/internal/errors/info.go index e24b6d0cf..b5f7bab95 100644 --- a/internal/errors/info.go +++ b/internal/errors/info.go @@ -287,6 +287,10 @@ var errorCodeInfo = map[Code]Info{ Message: "unsupported operation for a kms worker", Kind: State, }, + WorkerNotFoundForRequest: { + Message: "worker not found with all conditions required for request", + Kind: State, + }, QueueIsFull: { Message: "queue is full", Kind: State,