Get() methods from all repositories now return a ErrNotFound when the id is nonexistent

This commit is contained in:
Deluan
2016-03-18 11:33:50 -04:00
parent db34122faf
commit c90a50827a
11 changed files with 70 additions and 42 deletions
+3 -1
View File
@@ -6,7 +6,6 @@ import (
"fmt"
"reflect"
"strings"
"time"
"github.com/deluan/gosonic/domain"
@@ -228,6 +227,9 @@ func (r *ledisRepository) readEntity(id string) (interface{}, error) {
if err != nil {
return nil, err
}
if len(res[0]) == 0 {
return nil, domain.ErrNotFound
}
err = r.toEntity(res, entity)
return entity, err
}