1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

#1896 fatal when no needed update task

This commit is contained in:
Unknwon
2015-11-04 21:57:10 -05:00
parent 9372eedf2e
commit f255b1e86d
10 changed files with 66 additions and 46 deletions

View File

@@ -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
}