Get() methods from all repositories now return a ErrNotFound when the id is nonexistent
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user