Skip to content

Commit

Permalink
Optimized error exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed Oct 24, 2014
1 parent a094297 commit 404d06b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/vagrant-parallels/driver/meta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def initialize(uuid=nil)
# specific driver to instantiate.
begin
@version = read_version || ""
rescue Vagrant::Errors::CommandUnavailable,
Vagrant::Errors::CommandUnavailableWindows
rescue Vagrant::Errors::CommandUnavailable
# This means that Parallels Desktop was not found, so we raise this
# error here.
raise VagrantPlugins::Parallels::Errors::ParallelsNotDetected
Expand Down
5 changes: 1 addition & 4 deletions lib/vagrant-parallels/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ def self.usable?(raise_error=false)
# version and all that, which checks for Parallels Desktop being present
Driver::Meta.new
true
rescue VagrantPlugins::Parallels::Errors::ParallelsInvalidVersion
raise if raise_error
return false
rescue VagrantPlugins::Parallels::Errors::ParallelsNotDetected
rescue Errors::VagrantParallelsError
raise if raise_error
return false
end
Expand Down

0 comments on commit 404d06b

Please # to comment.