MCPcopy Index your code
hub / github.com/coder/coder / IsSerializedError

Function IsSerializedError

coderd/database/errors.go:10–16  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

8)
9
10func IsSerializedError(err error) bool {
11 var pqErr *pq.Error
12 if errors.As(err, &pqErr) {
13 return pqErr.Code.Name() == "serialization_failure"
14 }
15 return false
16}
17
18// IsUniqueViolation checks if the error is due to a unique violation.
19// If one or more specific unique constraints are given as arguments,

Callers 2

InTxMethod · 0.85

Calls 2

AsMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected