Skip to content

Commit

Permalink
Fix raise error invalid argument
Browse files Browse the repository at this point in the history
 - Kernel#raise takes caller string array as a third argument
 - But it appeared `reason` String passed while raising an error.
 - Reference https://ruby-doc.org/core-2.6.3/Kernel.html#method-i-raise

Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
  • Loading branch information
Vivek Singh committed Aug 12, 2019
1 parent b84b626 commit 416cf28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/train/extras/command_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def self.load(transport, options)
res = LinuxCommand.new(transport, options)
verification_res = res.verify
if verification_res
msg, reason = verification_res
raise Train::UserError, "Sudo failed: #{msg}", reason
msg, _reason = verification_res
raise Train::UserError, "Sudo failed: #{msg}"
end
res
elsif transport.platform.windows?
Expand Down

0 comments on commit 416cf28

Please sign in to comment.