From f255b1e86dae17dc0221b537d85f25bfa72a7912 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 4 Nov 2015 21:57:10 -0500 Subject: #1896 fatal when no needed update task --- models/error.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'models/error.go') 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) +} + // __ __ ___. .__ __ // / \ / \ ____\_ |__ | |__ ____ ____ | | __ // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ / -- cgit v1.2.3