浏览代码

fix: wrap error with parameters in GetError method of ControlResult

Jacky 1 月之前
父节点
当前提交
b4553e61ad
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      internal/nginx/control.go

+ 1 - 2
internal/nginx/control.go

@@ -1,7 +1,6 @@
 package nginx
 package nginx
 
 
 import (
 import (
-	"errors"
 	"net/http"
 	"net/http"
 	"strings"
 	"strings"
 
 
@@ -58,7 +57,7 @@ func (t *ControlResult) GetOutput() string {
 }
 }
 
 
 func (t *ControlResult) GetError() error {
 func (t *ControlResult) GetError() error {
-	return errors.New(t.GetOutput())
+	return cosy.WrapErrorWithParams(ErrNginx, t.GetOutput())
 }
 }
 
 
 func (t *ControlResult) GetLevel() int {
 func (t *ControlResult) GetLevel() int {