Browse Source

fix: wrap error with parameters in GetError method of ControlResult

Jacky 1 month ago
parent
commit
b4553e61ad
1 changed files with 1 additions and 2 deletions
  1. 1 2
      internal/nginx/control.go

+ 1 - 2
internal/nginx/control.go

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