From 84dd8cb39df76d5109581d2c5b5791d3b779bebb Mon Sep 17 00:00:00 2001 From: Matthew Howard <78384492+matthowardcohere@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:59:29 -0400 Subject: [PATCH] fix(credential): check Detail.Error in isCredentialConflictError for consistency Matches the pattern every other isXNotFoundError classifier in this file already follows. --- terraform/provider/litellm/utils.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/terraform/provider/litellm/utils.go b/terraform/provider/litellm/utils.go index 2a35973c929..a123f5d350a 100644 --- a/terraform/provider/litellm/utils.go +++ b/terraform/provider/litellm/utils.go @@ -221,6 +221,13 @@ func isCredentialConflictError(errResp ErrorResponse) bool { } } + // Check Detail.Error field for LiteLLM proxy error format + if errResp.Detail.Error != "" { + if strings.Contains(errResp.Detail.Error, "Unique constraint failed") && strings.Contains(errResp.Detail.Error, "credential_name") { + return true + } + } + return false }