MCPcopy
hub / github.com/redis/go-redis / IsAskError

Function IsAskError

error.go:333–338  ·  view source on GitHub ↗

IsAskError checks if an error is a Redis ASK error, even if wrapped. ASK errors occur in cluster mode when a key is being migrated and the client should ask another node. Returns the address of the node to ask and a boolean indicating if it's an ASK error.

(err error)

Source from the content-addressed store, hash-verified

331// ASK errors occur in cluster mode when a key is being migrated and the client should ask another node.
332// Returns the address of the node to ask and a boolean indicating if it's an ASK error.
333func IsAskError(err error) (addr string, ok bool) {
334 if askErr, isAskErr := proto.IsAskError(err); isAskErr {
335 return askErr.Addr(), true
336 }
337 return "", false
338}
339
340// IsAuthError checks if an error is a Redis authentication error, even if wrapped.
341// Authentication errors occur when:

Callers

nothing calls this directly

Calls 2

IsAskErrorFunction · 0.92
AddrMethod · 0.45

Tested by

no test coverage detected