1
0
Fork 0
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:
Jim Bugwadia 2020-07-03 19:02:42 -07:00 committed by GitHub
commit c6a52de604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}
}