mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-08 10:04:25 +00:00
Merge pull request #971 from nirmata/bugfix/fix_cli_npe
handle nil error
This commit is contained in:
commit
c6a52de604
1 changed files with 4 additions and 0 deletions
|
@ -15,6 +15,10 @@ func New(message string) error {
|
|||
}
|
||||
|
||||
func NewWithError(message string, err error) error {
|
||||
if err == nil {
|
||||
return customError{message: message}
|
||||
}
|
||||
|
||||
msg := fmt.Sprintf("%s \nCause: %s", message, err.Error())
|
||||
return customError{message: msg}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue