diff options
author | Franz Schmidt <valsatize@gmail.com> | 2016-06-27 11:02:39 +0200 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-06-27 17:02:39 +0800 |
commit | 8b35c194ecf5ff44a0b80595a5631e76e14fd0fb (patch) | |
tree | 2efcf19f367848d317ae20685db26ae352b2f2c4 /models/error.go | |
parent | ac05f886413bb5f2ca97b9af8ad5209619c138c0 (diff) | |
download | gitea-8b35c194ecf5ff44a0b80595a5631e76e14fd0fb.tar.gz gitea-8b35c194ecf5ff44a0b80595a5631e76e14fd0fb.zip |
Fixes #3110 (#3136)
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index cd7fa35de4..69b2962475 100644 --- a/models/error.go +++ b/models/error.go @@ -280,6 +280,18 @@ func (err ErrAccessTokenNotExist) Error() string { return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA) } +type ErrAccessTokenEmpty struct { +} + +func IsErrAccessTokenEmpty(err error) bool { + _, ok := err.(ErrAccessTokenEmpty) + return ok +} + +func (err ErrAccessTokenEmpty) Error() string { + return fmt.Sprintf("access token is empty") +} + // ________ .__ __ .__ // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____ // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \ |