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

Need better error message for improper inspec.yml formatting #1549

Closed
graham1228 opened this issue Mar 7, 2017 · 2 comments
Closed

Need better error message for improper inspec.yml formatting #1549

graham1228 opened this issue Mar 7, 2017 · 2 comments
Labels
Type: Enhancement Improves an existing feature

Comments

@graham1228
Copy link

graham1228 commented Mar 7, 2017

Description

If your inspec.yml file is not formatted properly you will receive an error that give little direction to what the issue is. InSpec should have a better error message.

InSpec and Platform Version

InSpec 1.7.2
Red Hat Enterprise Linux Server release 7.3 (Maipo)
kernel 3.10.0-514.el7.x86_64

Replication Case

  1. Create a inspec.yml file with the following
    https://gist.github.com/graham1228/ede5971d7d5543ce88e52189dd43fd03

  2. Execute a inspec check
    inspec check inspec_test

Possible Solutions

Add a better error message so the end user will have a better idea of what the actual problem is.

Stacktrace

https://gist.github.com/graham1228/3282a888609fe10d99b396380d93548f

@adamleff adamleff added the Type: Enhancement Improves an existing feature label Mar 7, 2017
@adamleff
Copy link
Contributor

adamleff commented Mar 7, 2017

Thanks for the issue, @graham1228! We can definitely make this better.

@adamleff adamleff self-assigned this Mar 8, 2017
@adamleff
Copy link
Contributor

adamleff commented Mar 8, 2017

New output will be:

"Unable to parse inspec.yml: line 8, could not find expected ':' while scanning a simple key"

... giving the user a clear indication that the error is caused by inspec.yml rather than getting a full stacktrack from the YAML parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants