mirror of
https://github.com/kubevela/kubevela.git
synced 2026-03-06 03:31:12 +00:00
* Fix: fix the envbinding can not be deleted bug * Fix: fix target must be interface or implement error Co-authored-by: barnettZQG <yiyun.pro>
29 lines
679 B
Go
29 lines
679 B
Go
package addon
|
|
|
|
import (
|
|
"github.com/google/go-github/v32/github"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// NewAddonError will return an
|
|
func NewAddonError(msg string) error {
|
|
return errors.New(msg)
|
|
}
|
|
|
|
var (
|
|
// ErrRenderCueTmpl is error when render addon's cue file
|
|
ErrRenderCueTmpl = NewAddonError("fail to render cue tmpl")
|
|
|
|
// ErrRateLimit means exceed github access rate limit
|
|
ErrRateLimit = NewAddonError("exceed github access rate limit")
|
|
)
|
|
|
|
// WrapErrRateLimit return ErrRateLimit if is the situation, or return error directly
|
|
func WrapErrRateLimit(err error) error {
|
|
var rateLimit *github.RateLimitError
|
|
if errors.As(err, &rateLimit) {
|
|
return ErrRateLimit
|
|
}
|
|
return err
|
|
}
|