aboutsummaryrefslogtreecommitdiffstats
path: root/models/auth/token.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/auth/token.go')
-rw-r--r--models/auth/token.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/auth/token.go b/models/auth/token.go
index 01654f2901..3afef832da 100644
--- a/models/auth/token.go
+++ b/models/auth/token.go
@@ -35,6 +35,10 @@ func (err ErrAccessTokenNotExist) Error() string {
return fmt.Sprintf("access token does not exist [sha: %s]", err.Token)
}
+func (err ErrAccessTokenNotExist) Unwrap() error {
+ return util.ErrNotExist
+}
+
// ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
type ErrAccessTokenEmpty struct{}
@@ -48,6 +52,10 @@ func (err ErrAccessTokenEmpty) Error() string {
return "access token is empty"
}
+func (err ErrAccessTokenEmpty) Unwrap() error {
+ return util.ErrInvalidArgument
+}
+
var successfulAccessTokenCache *lru.Cache
// AccessToken represents a personal access token.