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/update.go | |
parent | 9372eedf2ea7e8ccf8b127843e592765cbc1b034 (diff) | |
download | gitea-f255b1e86dae17dc0221b537d85f25bfa72a7912.tar.gz gitea-f255b1e86dae17dc0221b537d85f25bfa72a7912.zip |
#1896 fatal when no needed update task
Diffstat (limited to 'models/update.go')
-rw-r--r-- | models/update.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/models/update.go b/models/update.go index 9e8e5c916f..0ca202213c 100644 --- a/models/update.go +++ b/models/update.go @@ -28,6 +28,7 @@ func AddUpdateTask(task *UpdateTask) error { return err } +// GetUpdateTaskByUUID returns update task by given UUID. func GetUpdateTaskByUUID(uuid string) (*UpdateTask, error) { task := &UpdateTask{ UUID: uuid, @@ -36,7 +37,7 @@ func GetUpdateTaskByUUID(uuid string) (*UpdateTask, error) { if err != nil { return nil, err } else if !has { - return nil, fmt.Errorf("task does not exist: %s", uuid) + return nil, ErrUpdateTaskNotExist{uuid} } return task, nil } |