change: add exit code

This commit is contained in:
debugtalk
2022-10-21 21:39:18 +08:00
parent 775e42f7fa
commit 1f7737d0e7
14 changed files with 137 additions and 71 deletions
+3 -2
View File
@@ -7,6 +7,7 @@ import (
"testing"
"time"
"github.com/httprunner/httprunner/v4/hrp/internal/code"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
)
@@ -16,7 +17,7 @@ func buildHashicorpGoPlugin() {
err := BuildPlugin(tmpl("plugin/debugtalk.go"), tmpl("debugtalk.bin"))
if err != nil {
log.Error().Err(err).Msg("build hashicorp go plugin failed")
os.Exit(1)
os.Exit(code.GetErrorCode(err))
}
}
@@ -33,7 +34,7 @@ func buildHashicorpPyPlugin() {
err := ioutil.WriteFile(tmpl("debugtalk.py"), src, 0o644)
if err != nil {
log.Error().Err(err).Msg("copy hashicorp python plugin failed")
os.Exit(1)
os.Exit(code.GetErrorCode(err))
}
}