MCPcopy Create free account
hub / github.com/PostHog/duckgres / isQueryCancelled

Function isQueryCancelled

server/conn_errors.go:17–19  ·  view source on GitHub ↗

isQueryCancelled checks whether an error string indicates that *some* context cancellation was involved. It does NOT distinguish caller-driven cancellation (Ctrl-C, client disconnect, deadline) from infra-driven cancellation (worker died, CP closed the gRPC client) — both surface here as a wrapped "

(err error)

Source from the content-addressed store, hash-verified

15// since infra cancels are real failures we want surfaced. Use
16// (*clientConn).isCallerCancellation for that.
17func isQueryCancelled(err error) bool {
18 return err == context.Canceled || (err != nil && strings.Contains(err.Error(), "context canceled"))
19}
20
21// isCallerCancellation reports whether err is a cancellation that the caller
22// asked for — either through pgwire CancelRequest, an explicit ctx cancel, or

Callers 3

markErrorMethod · 0.85
isCallerCancellationMethod · 0.85
classifyErrorCodeFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected