Assume no box found if find returns an error

This commit is contained in:
sophia 2021-11-15 16:39:47 -06:00 committed by Paul Hinze
parent 6adb36cec3
commit c50ca3a991
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -47,9 +47,14 @@ module VagrantPlugins
# @return [Vagrant::Box] box found
def find(name, providers, version)
res = client.find(SDK::BoxCollection::FindRequest.new(
name: name, version: version, providers: Array(providers)
))
begin
res = client.find(SDK::BoxCollection::FindRequest.new(
name: name, version: version, providers: Array(providers)
))
rescue
logger.debug("box not found!")
return nil
end
box_client = Box.load(res, broker: broker)
box = Vagrant::Box.new(
box_client.name,