mukan-ignite/ignite/config/chain/errors.go
Mukan Erkin Törük c32551b6f7
Some checks failed
Docs Deploy / build_and_deploy (push) Has been cancelled
Generate Docs / cli (push) Has been cancelled
Generate Config Doc / cli (push) Has been cancelled
Go formatting / go-formatting (push) Has been cancelled
Check links / markdown-link-check (push) Has been cancelled
Integration / pre-test (push) Has been cancelled
Integration / test on (push) Has been cancelled
Integration / status (push) Has been cancelled
Lint / Lint Go code (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
refactor: replace all github.com upstream refs with git.cw.tr/mukan-network
2026-05-11 03:36:24 +03:00

50 lines
1.3 KiB
Go

package chain
import (
"fmt"
"git.cw.tr/mukan-network/mukan-ignite/ignite/config/chain/version"
"git.cw.tr/mukan-network/mukan-ignite/ignite/pkg/errors"
)
// ErrConfigNotFound indicates that the config.yml can't be found.
var ErrConfigNotFound = errors.New("could not locate a config.yml in your chain")
// ValidationError is returned when a configuration is invalid.
type ValidationError struct {
Message string
}
func (e ValidationError) Error() string {
return fmt.Sprintf("config is not valid: %s", e.Message)
}
// UnsupportedVersionError is returned when the version of the config is not supported.
type UnsupportedVersionError struct {
Version version.Version
}
func (e UnsupportedVersionError) Error() string {
return fmt.Sprintf("config version %s is not supported", e.Version)
}
// VersionError is returned when config version doesn't match with the version CLI supports.
type VersionError struct {
Version version.Version
}
func (e VersionError) Error() string {
if LatestVersion > e.Version {
return fmt.Sprintf(
"blockchain app uses a previous config version %s and CLI expects %s",
e.Version,
LatestVersion,
)
}
return fmt.Sprintf(
"blockchain app uses a newer config version %s and CLI expects %s",
e.Version,
LatestVersion,
)
}