mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
feat: 优化errorCode报错
This commit is contained in:
@@ -131,7 +131,7 @@ func RenderSuccess(c *gin.Context, result interface{}) {
|
||||
|
||||
func RenderError(c *gin.Context, err error) {
|
||||
log.Error().Err(err).Msgf("failed to %s", c.HandlerName())
|
||||
c.JSON(http.StatusOK,
|
||||
c.JSON(http.StatusInternalServerError,
|
||||
HttpResponse{
|
||||
Code: code.GetErrorCode(err),
|
||||
Message: "grey " + err.Error(),
|
||||
@@ -146,7 +146,7 @@ func RenderErrorInitDriver(c *gin.Context, err error) {
|
||||
if errCode == code.GeneralFail {
|
||||
errCode = code.GetErrorCode(code.MobileUIDriverError)
|
||||
}
|
||||
c.JSON(http.StatusOK,
|
||||
c.JSON(http.StatusInternalServerError,
|
||||
HttpResponse{
|
||||
Code: errCode,
|
||||
Message: "grey init driver failed",
|
||||
|
||||
Reference in New Issue
Block a user