Skip to content

Throw error instead of warning for profiles #392

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

Merged
merged 2 commits into from
Dec 2, 2015

Conversation

quoctruong
Copy link

For most cases, we will throw error and stop executing scriptanalyzer. If the user uses an unknown key, we will just issue warning instead.

@raghushantha
Copy link
Member

Thanks for the PR, Quoc. For the Warnings - add information about the supported set of keys, so that the user gets an idea of the supported set.

@juneb
Copy link
Contributor

juneb commented Dec 2, 2015

Why use a warning? If the user intended a config/profile value and it failed, they're likely to get the wrong output. I think generating output is confusing, which is why I recommended a terminating error. If that doesn't work, I would, at least, generate a non-terminating error.

@raghushantha
Copy link
Member

We want the Engine to be flexible and continue execution as long as it received the correct set of keys. For non-existent/invalid keys, our thinking was to inform the user as a warning since it is simply an anomaly in the input.

I do agree that we have to be consistent in handling all invalid user input across ScriptAnalyzer (ScriptPaths, CustomRulePaths, Profiles, Rule filters etc)

So in this case, we can do #1
(emit non-terminating errors for each issue in Profile and stop the Engine execution - This will prevent any rules from running)

@raghushantha
Copy link
Member

LGTM. Pls Merge

@quoctruong
Copy link
Author

Thanks!

quoctruong pushed a commit that referenced this pull request Dec 2, 2015
…Profiles

Throw error instead of warning for profiles
@quoctruong quoctruong merged commit cbf5b07 into development Dec 2, 2015
@quoctruong quoctruong deleted the ThrowErrorInsteadOfWarningForProfiles branch December 2, 2015 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants