mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Exception handling while starting a domain.
This commit is contained in:
@@ -16,7 +16,12 @@ module VagrantPlugins
|
|||||||
|
|
||||||
domain = env[:libvirt_compute].servers.get(env[:machine].id.to_s)
|
domain = env[:libvirt_compute].servers.get(env[:machine].id.to_s)
|
||||||
raise Errors::NoDomainError if domain == nil
|
raise Errors::NoDomainError if domain == nil
|
||||||
|
|
||||||
|
begin
|
||||||
domain.start
|
domain.start
|
||||||
|
rescue => e
|
||||||
|
raise Errors::FogError, :message => e.message
|
||||||
|
end
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ module VagrantPlugins
|
|||||||
|
|
||||||
|
|
||||||
# Fog libvirt exceptions
|
# Fog libvirt exceptions
|
||||||
|
class FogError < VagrantLibvirtError
|
||||||
|
error_key(:fog_error)
|
||||||
|
end
|
||||||
|
|
||||||
class FogLibvirtConnectionError < VagrantLibvirtError
|
class FogLibvirtConnectionError < VagrantLibvirtError
|
||||||
error_key(:fog_libvirt_connection_error)
|
error_key(:fog_libvirt_connection_error)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user