aboutsummaryrefslogtreecommitdiffstats
path: root/entity/err.go
diff options
context:
space:
mode:
Diffstat (limited to 'entity/err.go')
-rw-r--r--entity/err.go26
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)
+}