argo-cd/util/errors/credentials.go
Matthieu MOREL d7e99224d4
chore: enable errorlint linter on util folder (#18588)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-11 10:42:32 -04:00

22 lines
642 B
Go

package errors
import "errors"
type credentialsConfigurationError struct {
causingError error
}
func (err *credentialsConfigurationError) Error() string {
return err.causingError.Error()
}
// NewCredentialsConfigurationError wraps any error into a credentials configuration error.
func NewCredentialsConfigurationError(err error) error {
return &credentialsConfigurationError{causingError: err}
}
// IsCredentialsConfigurationError checks if the given error is a wrapped credentials configuration error.
func IsCredentialsConfigurationError(err error) bool {
var ccErr *credentialsConfigurationError
return errors.As(err, &ccErr)
}