MCPcopy
hub / github.com/cloudflare/cloudflared / action

Function action

cmd/cloudflared/main.go:170–184  ·  view source on GitHub ↗
(graceShutdownC chan struct{})

Source from the content-addressed store, hash-verified

168}
169
170func action(graceShutdownC chan struct{}) cli.ActionFunc {
171 return cliutil.ConfiguredAction(func(c *cli.Context) (err error) {
172 if isEmptyInvocation(c) {
173 return handleServiceMode(c, graceShutdownC)
174 }
175 func() {
176 defer sentry.Recover()
177 err = tunnel.TunnelCommand(c)
178 }()
179 if err != nil {
180 captureError(err)
181 }
182 return err
183 })
184}
185
186// In order to keep the amount of noise sent to Sentry low, typical network errors can be filtered out here by a substring match.
187func captureError(err error) {

Callers 1

mainFunction · 0.85

Calls 5

ConfiguredActionFunction · 0.92
TunnelCommandFunction · 0.92
isEmptyInvocationFunction · 0.85
handleServiceModeFunction · 0.85
captureErrorFunction · 0.85

Tested by

no test coverage detected