(cli *cli, executionErr error)
| 244 | } |
| 245 | |
| 246 | func 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 | |
| 275 | func commandTrackingProperties(cli *cli) map[string]string { |
| 276 | interactive := iostream.IsInputTerminal() && iostream.IsOutputTerminal() |
no test coverage detected