diff options
author | Michael Muré <batolettre@gmail.com> | 2020-12-15 14:21:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 14:21:23 +0100 |
commit | 078c85be4ece0e3d3c1dd9b71c819fa70ea3348b (patch) | |
tree | 2db523e976d01ddf83625118f85f056139326cc4 /entity | |
parent | 0545ad6a6c478ddf8cf17c078df9e1c92a3f4083 (diff) | |
parent | e3737f216a7b6a36a2ba10146f2d228f32dcbcfb (diff) | |
download | git-bug-078c85be4ece0e3d3c1dd9b71c819fa70ea3348b.tar.gz |
Merge pull request #518 from MichaelMure/expose-format-version
expose format version
Diffstat (limited to 'entity')
-rw-r--r-- | entity/err.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/entity/err.go b/entity/err.go index 7d6c662e..90304d03 100644 --- a/entity/err.go +++ b/entity/err.go @@ -30,3 +30,29 @@ func IsErrMultipleMatch(err error) bool { _, ok := err.(*ErrMultipleMatch) return ok } + +// ErrOldFormatVersion indicate that the read data has a too old format. +type ErrOldFormatVersion struct { + formatVersion uint +} + +func NewErrOldFormatVersion(formatVersion uint) *ErrOldFormatVersion { + return &ErrOldFormatVersion{formatVersion: formatVersion} +} + +func (e ErrOldFormatVersion) Error() string { + return fmt.Sprintf("outdated repository format %v, please use https://github.com/MichaelMure/git-bug-migration to upgrade", e.formatVersion) +} + +// ErrNewFormatVersion indicate that the read data is too new for this software. +type ErrNewFormatVersion struct { + formatVersion uint +} + +func NewErrNewFormatVersion(formatVersion uint) *ErrNewFormatVersion { + return &ErrNewFormatVersion{formatVersion: formatVersion} +} + +func (e ErrNewFormatVersion) Error() string { + return fmt.Sprintf("your version of git-bug is too old for this repository (version %v), please upgrade to the latest version", e.formatVersion) +} |