MCPcopy
hub / github.com/devtron-labs/devtron / IsResourceConflictError

Function IsResourceConflictError

internal/util/ErrorUtil.go:93–105  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

91 return pg.ErrNoRows == err
92}
93func IsResourceConflictError(err error) bool {
94 var resourceConflictPhrases = []string{
95 "already exists",
96 "already used",
97 }
98 msg := err.Error()
99 for _, phrase := range resourceConflictPhrases {
100 if strings.Contains(msg, phrase) {
101 return true
102 }
103 }
104 return false
105}
106func GetClientErrorDetailedMessage(err error) string {
107 if errStatus, ok := status.FromError(err); ok {
108 return errStatus.Message()

Callers 1

WriteJsonRespFunction · 0.92

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…