aboutsummaryrefslogtreecommitdiffstats
path: root/models/foreignreference/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/foreignreference/error.go')
-rw-r--r--models/foreignreference/error.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/foreignreference/error.go b/models/foreignreference/error.go
index d783a08730..a1db773cd2 100644
--- a/models/foreignreference/error.go
+++ b/models/foreignreference/error.go
@@ -6,6 +6,8 @@ package foreignreference
import (
"fmt"
+
+ "code.gitea.io/gitea/modules/util"
)
// ErrLocalIndexNotExist represents a "LocalIndexNotExist" kind of error.
@@ -25,6 +27,10 @@ func (err ErrLocalIndexNotExist) Error() string {
return fmt.Sprintf("repository %d has no LocalIndex for ForeignIndex %d of type %s", err.RepoID, err.ForeignIndex, err.Type)
}
+func (err ErrLocalIndexNotExist) Unwrap() error {
+ return util.ErrNotExist
+}
+
// ErrForeignIndexNotExist represents a "ForeignIndexNotExist" kind of error.
type ErrForeignIndexNotExist struct {
RepoID int64
@@ -41,3 +47,7 @@ func IsErrForeignIndexNotExist(err error) bool {
func (err ErrForeignIndexNotExist) Error() string {
return fmt.Sprintf("repository %d has no ForeignIndex for LocalIndex %d of type %s", err.RepoID, err.LocalIndex, err.Type)
}
+
+func (err ErrForeignIndexNotExist) Unwrap() error {
+ return util.ErrNotExist
+}