mirror of https://github.com/status-im/consul.git
Add helper for generating better permission denied errors
This commit is contained in:
parent
9f7b22a5eb
commit
1dba94311a
|
@ -2,6 +2,7 @@ package acl
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -70,3 +71,8 @@ func (e PermissionDeniedError) Error() string {
|
|||
}
|
||||
return errPermissionDenied
|
||||
}
|
||||
|
||||
func PermissionDenied(msg string, args ...interface{}) PermissionDeniedError {
|
||||
cause := fmt.Sprintf(msg, args...)
|
||||
return PermissionDeniedError{Cause: cause}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue