Box find should return nil on not found
This commit is contained in:
parent
247b6f55d0
commit
eab9ef8e66
@ -318,12 +318,15 @@ func (s *State) BoxFind(
|
||||
},
|
||||
)
|
||||
if result.Error != nil {
|
||||
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, lookupErrorToStatus("box", result.Error)
|
||||
}
|
||||
|
||||
// If we found no boxes, return a not found error
|
||||
if len(boxes) < 1 {
|
||||
return nil, lookupErrorToStatus("box", gorm.ErrRecordNotFound)
|
||||
return nil, nil // lookupErrorToStatus("box", gorm.ErrRecordNotFound)
|
||||
}
|
||||
|
||||
// If we have no version value set, apply the default
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user