mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 07:57:27 +08:00
change: print hrp exit code
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/getsentry/sentry-go"
|
"github.com/getsentry/sentry-go"
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
|
|
||||||
"github.com/httprunner/httprunner/v4/hrp/cmd"
|
"github.com/httprunner/httprunner/v4/hrp/cmd"
|
||||||
)
|
)
|
||||||
@@ -23,6 +22,5 @@ func main() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
exitCode := cmd.Execute()
|
exitCode := cmd.Execute()
|
||||||
log.Info().Int("code", exitCode).Msg("hrp exit")
|
|
||||||
os.Exit(exitCode)
|
os.Exit(exitCode)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,10 +156,6 @@ func IsErrorPredefined(err error) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetErrorCode(err error) (errCode int) {
|
func GetErrorCode(err error) (errCode int) {
|
||||||
defer func() {
|
|
||||||
log.Debug().Int("code", errCode).Msg("get error code")
|
|
||||||
}()
|
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return Success
|
return Success
|
||||||
}
|
}
|
||||||
@@ -170,5 +166,7 @@ func GetErrorCode(err error) (errCode int) {
|
|||||||
} else {
|
} else {
|
||||||
errCode = GeneralFail
|
errCode = GeneralFail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Warn().Int("code", errCode).Msg("hrp exit")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user