MCPcopy Create free account
hub / github.com/auth0/auth0-cli / trackCommandOutcome

Function trackCommandOutcome

internal/cli/root.go:246–273  ·  view source on GitHub ↗
(cli *cli, executionErr error)

Source from the content-addressed store, hash-verified

244}
245
246func trackCommandOutcome(cli *cli, executionErr error) {
247 if cli.tracker == nil {
248 return
249 }
250
251 installID := resolveInstallIDForTracking(cli)
252 if installID == "" {
253 return
254 }
255
256 if cli.executedCommandPath == "" {
257 cli.executedCommandPath = "auth0"
258 }
259
260 properties := commandTrackingProperties(cli)
261
262 if executionErr != nil {
263 failureProperties := mergeProperties(properties, classifyCommandFailure(executionErr))
264 cli.tracker.TrackCommandRun(cli.executedCommandPath, installID, failureProperties)
265 return
266 }
267
268 successProperties := mergeProperties(properties, map[string]string{
269 "success": "true",
270 "error_class": "none",
271 })
272 cli.tracker.TrackCommandRun(cli.executedCommandPath, installID, successProperties)
273}
274
275func commandTrackingProperties(cli *cli) map[string]string {
276 interactive := iostream.IsInputTerminal() && iostream.IsOutputTerminal()

Callers 1

ExecuteFunction · 0.85

Calls 5

mergePropertiesFunction · 0.85
classifyCommandFailureFunction · 0.85
TrackCommandRunMethod · 0.80

Tested by

no test coverage detected