diff --git a/internal/acl/matcher.go b/internal/acl/matcher.go index 19022c3..b19daf8 100644 --- a/internal/acl/matcher.go +++ b/internal/acl/matcher.go @@ -1,7 +1,6 @@ package acl import ( - "errors" "net" "strings" @@ -37,9 +36,9 @@ var errMatcherFormat = gperr.Multiline().AddLines( ) var ( - errSyntax = errors.New("syntax error") - errInvalidIP = errors.New("invalid IP") - errInvalidCIDR = errors.New("invalid CIDR") + errSyntax = gperr.New("syntax error") + errInvalidIP = gperr.New("invalid IP") + errInvalidCIDR = gperr.New("invalid CIDR") ) func (matcher *Matcher) Parse(s string) error { diff --git a/internal/gperr/subject.go b/internal/gperr/subject.go index 3a336f0..1d36293 100644 --- a/internal/gperr/subject.go +++ b/internal/gperr/subject.go @@ -136,6 +136,9 @@ func (err *withSubject) MarshalJSON() ([]byte, error) { Subjects: subjects, Err: err.Err, } + if err.pendingSubject != "" { + reversed.Subjects = append(reversed.Subjects, err.pendingSubject) + } return json.Marshal(reversed) } diff --git a/internal/watcher/health/monitor/monitor.go b/internal/watcher/health/monitor/monitor.go index 1d33491..73cc97d 100644 --- a/internal/watcher/health/monitor/monitor.go +++ b/internal/watcher/health/monitor/monitor.go @@ -35,7 +35,7 @@ type ( } ) -var ErrNegativeInterval = errors.New("negative interval") +var ErrNegativeInterval = gperr.New("negative interval") func NewMonitor(r routes.Route) health.HealthMonCheck { var mon health.HealthMonCheck