summaryrefslogtreecommitdiffstats
path: root/models/error.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-02 02:40:15 -0400
committerUnknwon <u@gogs.io>2015-09-02 02:40:15 -0400
commit2ac8e11f466f838ff34314c5e4e2785ebe2d036d (patch)
tree7dbf30a4d51d634f660f6bfa5814f4cfd53593de /models/error.go
parentebf1bd4f518971253e0a7a0e923645c1d584e03e (diff)
downloadgitea-2ac8e11f466f838ff34314c5e4e2785ebe2d036d.tar.gz
gitea-2ac8e11f466f838ff34314c5e4e2785ebe2d036d.zip
#842 able to use access token replace basic auth
Diffstat (limited to 'models/error.go')
-rw-r--r--models/error.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go
index 4d888c870b..92cc187b43 100644
--- a/models/error.go
+++ b/models/error.go
@@ -183,6 +183,26 @@ func (err ErrDeployKeyNameAlreadyUsed) Error() string {
return fmt.Sprintf("public key already exists: [repo_id: %d, name: %s]", err.RepoID, err.Name)
}
+// _____ ___________ __
+// / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
+// / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
+// / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
+// \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
+// \/ \/ \/ \/ \/ \/ \/ \/ \/
+
+type ErrAccessTokenNotExist struct {
+ SHA string
+}
+
+func IsErrAccessTokenNotExist(err error) bool {
+ _, ok := err.(ErrAccessTokenNotExist)
+ return ok
+}
+
+func (err ErrAccessTokenNotExist) Error() string {
+ return fmt.Sprintf("access token does not exist: [sha: %s]", err.SHA)
+}
+
// ________ .__ __ .__
// \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
// / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \