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)
|
||||
raise Errors::NoDomainError if domain == nil
|
||||
domain.start
|
||||
|
||||
begin
|
||||
domain.start
|
||||
rescue => e
|
||||
raise Errors::FogError, :message => e.message
|
||||
end
|
||||
|
||||
@app.call(env)
|
||||
end
|
||||
|
||||
@@ -48,6 +48,10 @@ module VagrantPlugins
|
||||
|
||||
|
||||
# Fog libvirt exceptions
|
||||
class FogError < VagrantLibvirtError
|
||||
error_key(:fog_error)
|
||||
end
|
||||
|
||||
class FogLibvirtConnectionError < VagrantLibvirtError
|
||||
error_key(:fog_libvirt_connection_error)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user