Skip to content

Commit

Permalink
Fix incorrect error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonMatthes committed Mar 13, 2019
1 parent da4b9a6 commit 24011c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/api/v_sphere/folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def move_here(folder_entry)

def create_vm(cpu, ram, capacity, name, cluster)
return nil if cluster.networks.empty?

vm_config = creation_config(cpu, ram, capacity, name, cluster.networks.first)
vm = @folder.CreateVM_Task(config: vm_config, pool: cluster.resource_pool).wait_for_completion
VSphere::VirtualMachine.new vm
Expand Down
2 changes: 1 addition & 1 deletion app/models/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def push_to_git_with_warnings
nil
rescue Git::GitExecuteError => error
logger.error error
"Your VM was created, but users could not be associated with the VM! Push to git failed, error:\n\"#{e.message}\""
"Your VM was created, but users could not be associated with the VM! Push to git failed, error:\n\"#{error.message}\""
end

# Error handling has been moved into push_to_git_with_warnings to provide easier feedback for the user
Expand Down

0 comments on commit 24011c3

Please sign in to comment.