mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-06-14 19:20:01 -04:00
Box find should return nil on not found
This commit is contained in:
parent
247b6f55d0
commit
eab9ef8e66
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Reference in a new issue