Files
devstar-create-from-template/modules/k8s/application/errors/errors.go
2025-08-25 15:46:12 +08:00

36 lines
908 B
Go

package application_errors
import "fmt"
// ErrIllegalApplicationParameters 非法参数错误
type ErrIllegalApplicationParameters struct {
FieldList []string
Message string
}
func (err ErrIllegalApplicationParameters) Error() string {
return fmt.Sprintf("Illegal Application parameters: fields %v %s", err.FieldList, err.Message)
}
// ErrOperateApplication 操作 Application 错误
type ErrOperateApplication struct {
Action string
Message string
}
func (err ErrOperateApplication) Error() string {
return fmt.Sprintf("Failed to %s: %s", err.Action, err.Message)
}
// ErrK8sApplicationNotReady Application 未就绪错误
type ErrK8sApplicationNotReady struct {
Name string
Namespace string
Wait bool
}
func (err ErrK8sApplicationNotReady) Error() string {
return fmt.Sprintf("Application '%s' in namespace '%s' is not ready (wait=%v)",
err.Name, err.Namespace, err.Wait)
}