diff options
author | Unknwon <u@gogs.io> | 2015-11-04 21:57:10 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-04 21:57:10 -0500 |
commit | f255b1e86dae17dc0221b537d85f25bfa72a7912 (patch) | |
tree | 7b27cb470f8f2a3772bf02e756c0c2ba6f50cd96 /models/error.go | |
parent | 9372eedf2ea7e8ccf8b127843e592765cbc1b034 (diff) | |
download | gitea-f255b1e86dae17dc0221b537d85f25bfa72a7912.tar.gz gitea-f255b1e86dae17dc0221b537d85f25bfa72a7912.zip |
#1896 fatal when no needed update task
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index 7c89373183..8f508598a1 100644 --- a/models/error.go +++ b/models/error.go @@ -275,6 +275,19 @@ func (err ErrInvalidCloneAddr) Error() string { err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied) } +type ErrUpdateTaskNotExist struct { + UUID string +} + +func IsErrUpdateTaskNotExist(err error) bool { + _, ok := err.(ErrUpdateTaskNotExist) + return ok +} + +func (err ErrUpdateTaskNotExist) Error() string { + return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID) +} + // __ __ ___. .__ __ // / \ / \ ____\_ |__ | |__ ____ ____ | | __ // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ / |