43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
/*
|
|
* Copyright (c) Mengning Software. 2025. All rights reserved.
|
|
* Authors: DevStar Team, panshuxiao
|
|
* Create: 2025-11-19
|
|
* Description: Error helpers for the application module.
|
|
*/
|
|
|
|
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)
|
|
}
|