浏览代码

修改报错

yjp 3 年之前
父节点
当前提交
15f50c388a
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      utils/utils.go

+ 1 - 2
utils/utils.go

@@ -1,7 +1,6 @@
 package utils
 
 import (
-	"errors"
 	"fmt"
 	"github.com/go-resty/resty/v2"
 	uuid "github.com/satori/go.uuid"
@@ -48,7 +47,7 @@ func SimpleUUID() string {
 
 func ResponseStatusError(resp *resty.Response) error {
 	if resp.Body() != nil && len(resp.Body()) != 0 {
-		return errors.New(string(resp.Body()))
+		return fmt.Errorf("Status: %d %s\n", resp.StatusCode(), resp.Body())
 	} else {
 		return fmt.Errorf("Status: %d %s\n", resp.StatusCode(), resp.Status())
 	}