Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix raise invalid arguments #508

Conversation

kvivek1115
Copy link

@kvivek1115 kvivek1115 commented Aug 12, 2019

Fixed improper error msg raised backtrace must be Array of String (TypeError)

Before Fix:

backtrace must be Array of String (TypeError)

After Fix:

Sudo failed: Sudo requires a TTY. Please see the README on how to configure sudo to allow for non-interactive usage. (Train::UserError)

Description

Related Issue

#506

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

Signed-off-by: Vivek Singh vivek.singh@msystechnologies.com

 - 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>
@codeclimate
Copy link

codeclimate bot commented Aug 12, 2019

Code Climate has analyzed commit 416cf28 and detected 0 issues on this pull request.

View more on Code Climate.

@kvivek1115 kvivek1115 changed the title Fix raise error invalid argument Fix raise invalid arguments Aug 13, 2019
msg, reason = verification_res
raise Train::UserError, "Sudo failed: #{msg}", reason
msg, _reason = verification_res
raise Train::UserError, "Sudo failed: #{msg}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. Good find... but that verify method is just a mess and should be cleaned up (in a different PR). Returning nil or a string or an array of a string or a symbol is not right. I'll file a separate issue against that. Thank you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zenspider, will cleanup verify method thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants