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

Method checkResumeTokenFailure

codersdk/workspacesdk/dialer.go:48–61  ·  view source on GitHub ↗

checkResumeTokenFailure checks if the parsed error indicates a resume token failure and updates the resumeTokenFailed flag accordingly. Returns true if a resume token failure was detected.

(ctx context.Context, sdkErr *codersdk.Error)

Source from the content-addressed store, hash-verified

46// and updates the resumeTokenFailed flag accordingly. Returns true if a resume token
47// failure was detected.
48func (w *WebsocketDialer) checkResumeTokenFailure(ctx context.Context, sdkErr *codersdk.Error) bool {
49 if sdkErr == nil {
50 return false
51 }
52
53 for _, v := range sdkErr.Validations {
54 if v.Field == "resume_token" {
55 w.logger.Warn(ctx, "failed to dial tailnet v2+ API: server replied invalid resume token; unsetting for next connection attempt")
56 w.resumeTokenFailed = true
57 return true
58 }
59 }
60 return false
61}
62
63type WebsocketDialerOption func(*WebsocketDialer)
64

Callers 1

DialMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected