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

Function IsQueryCanceledError

coderd/database/errors.go:85–94  ·  view source on GitHub ↗

IsQueryCanceledError checks if the error is due to a query being canceled.

(err error)

Source from the content-addressed store, hash-verified

83
84// IsQueryCanceledError checks if the error is due to a query being canceled.
85func IsQueryCanceledError(err error) bool {
86 var pqErr *pq.Error
87 if errors.As(err, &pqErr) {
88 return pqErr.Code == "57014" // query_canceled
89 } else if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
90 return true
91 }
92
93 return false
94}
95
96func IsWorkspaceAgentLogsLimitError(err error) bool {
97 var pqErr *pq.Error

Callers 15

monitorMethod · 0.92
processMethod · 0.92
startMethod · 0.92
ReportAgentStatsMethod · 0.92
ActivityBumpWorkspaceFunction · 0.92
flushMethod · 0.92
UpdateLifecycleMethod · 0.92
flushMethod · 0.92
heartbeatLoopMethod · 0.92
AcquireJobMethod · 0.92
AcquireJobWithCancelMethod · 0.92

Calls 2

AsMethod · 0.80
IsMethod · 0.45

Tested by 1