From 2c30cba9028e3bae08482a857b7bf50a82a7f269 Mon Sep 17 00:00:00 2001 From: Feyi Date: Thu, 7 Aug 2025 10:55:08 -0700 Subject: [PATCH] test fix --- main/cmds.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main/cmds.go b/main/cmds.go index 1a674c7..5127505 100644 --- a/main/cmds.go +++ b/main/cmds.go @@ -245,16 +245,18 @@ func runCmd(ctx log.Logger, dir string, cfg handlerSettings) (ewc error) { } begin := time.Now() - var isEwc bool - ewc, isEwc = ExecCmdInDir(cmd, dir).(vmextension.ErrorWithClarification) + + executeError := ExecCmdInDir(cmd, dir) elapsed := time.Now().Sub(begin) - isSuccess := ewc == nil + isSuccess := executeError == nil telemetry("scenario", scenario, isSuccess, elapsed) - if ewc != nil && isEwc { + if executeError != nil { ctx.Log("event", "failed to execute command", "error", err, "output", dir) - return ewc + customErr := executeError.(vmextension.ErrorWithClarification) + customErr.Err = errors.Wrap(customErr.Err, "failed to execute command") + return customErr } ctx.Log("event", "executed command", "output", dir) return nil