{"action":"created","issue":{"url":"https://api.github.com/repos/fog/fog-vsphere/issues/43","repository_url":"https://api.github.com/repos/fog/fog-vsphere","labels_url":"https://api.github.com/repos/fog/fog-vsphere/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/fog/fog-vsphere/issues/43/comments","events_url":"https://api.github.com/repos/fog/fog-vsphere/issues/43/events","html_url":"https://github.com/fog/fog-vsphere/pull/43","id":171875769,"number":43,"title":"Don't destroy stacktrace when things go wrong","user":{"login":"ace13","id":534460,"avatar_url":"https://avatars.githubusercontent.com/u/534460?v=3","gravatar_id":"","url":"https://api.github.com/users/ace13","html_url":"https://github.com/ace13","followers_url":"https://api.github.com/users/ace13/followers","following_url":"https://api.github.com/users/ace13/following{/other_user}","gists_url":"https://api.github.com/users/ace13/gists{/gist_id}","starred_url":"https://api.github.com/users/ace13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ace13/subscriptions","organizations_url":"https://api.github.com/users/ace13/orgs","repos_url":"https://api.github.com/users/ace13/repos","events_url":"https://api.github.com/users/ace13/events{/privacy}","received_events_url":"https://api.github.com/users/ace13/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-18T11:06:56Z","updated_at":"2016-08-18T13:33:16Z","closed_at":"2016-08-18T11:47:03Z","pull_request":{"url":"https://api.github.com/repos/fog/fog-vsphere/pulls/43","html_url":"https://github.com/fog/fog-vsphere/pull/43","diff_url":"https://github.com/fog/fog-vsphere/pull/43.diff","patch_url":"https://github.com/fog/fog-vsphere/pull/43.patch"},"body":"Currently, if anything gets caught by either of these handlers then the re-raised exception will be lacking the original stacktrace, which makes debugging the underlying cause impossible.\r\n\r\nExample trace;\r\n```\r\nfailed to create vm: NoPermission: Permission to perform this operation was denied.\r\n   \r\nRbVmomi::Fault: failed to create vm: NoPermission: Permission to perform this operation was denied.\r\n  /usr/lib/ruby/gems/2.1.0/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/create_vm.rb:44:in `rescue in create_vm'\r\n  /usr/lib/ruby/gems/2.1.0/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/create_vm.rb:8:in `create_vm'\r\n  /usr/lib/ruby/gems/2.1.0/gems/fog-vsphere-1.0.0/lib/fog/vsphere/models/compute/server.rb:273:in `save'\r\n  /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:364:in `create_vm'\r\n  /usr/share/foreman/app/models/concerns/orchestration/compute.rb:82:in `setCompute'\r\n  /usr/share/foreman/app/models/concerns/orchestration.rb:162:in `execute'\r\n  /usr/share/foreman/app/models/concerns/orchestration.rb:107:in `block in process'\r\n  /usr/share/foreman/app/models/concerns/orchestration.rb:99:in `each'\r\n  /usr/share/foreman/app/models/concerns/orchestration.rb:99:in `process'\r\n  /usr/share/foreman/app/models/concerns/orchestration.rb:35:in `on_save'\r\n...\r\n```\r\n\r\nAs can be seen, the trace ends on the rescue block where it's repackaged and re-raised.\r\n\r\nThis PR solves the issue by passing along the original exception backtrace into the repackaged exception object."},"comment":{"url":"https://api.github.com/repos/fog/fog-vsphere/issues/comments/240723848","html_url":"https://github.com/fog/fog-vsphere/pull/43#issuecomment-240723848","issue_url":"https://api.github.com/repos/fog/fog-vsphere/issues/43","id":240723848,"user":{"login":"jrgarcia","id":59989,"avatar_url":"https://avatars.githubusercontent.com/u/59989?v=3","gravatar_id":"","url":"https://api.github.com/users/jrgarcia","html_url":"https://github.com/jrgarcia","followers_url":"https://api.github.com/users/jrgarcia/followers","following_url":"https://api.github.com/users/jrgarcia/following{/other_user}","gists_url":"https://api.github.com/users/jrgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/jrgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrgarcia/subscriptions","organizations_url":"https://api.github.com/users/jrgarcia/orgs","repos_url":"https://api.github.com/users/jrgarcia/repos","events_url":"https://api.github.com/users/jrgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/jrgarcia/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T13:33:16Z","updated_at":"2016-08-18T13:33:16Z","body":"Thanks @ace13 and @plribeiro3000!"}}
{"actor":{"display_login":"jrgarcia"}}