Skip to content

Actionable messages for ast parser errors #14

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 1 commit into from
Apr 9, 2015
Merged

Conversation

raghushantha
Copy link
Member

Supply parser errors with file and line information to ParseException constructor

@yutingc
Copy link
Contributor

yutingc commented Apr 9, 2015

So there are no change of behaviors?

@raghushantha
Copy link
Member Author

Here is the before and after. The output will not display System.Error.

Before:
Invoke-ScriptAnalyzer : System.Error
At line:1 char:1

  • Invoke-ScriptAnalyzer -Path "C:\Program Files\WindowsPowerShell\Modul ...
  • - CategoryInfo          : ParserError: (UnexpectedToken:String) [Invoke-ScriptAnalyzer], ParseException
    - FullyQualifiedErrorId : Parse error in file C:\Program Files\WindowsPowerShell\Modules\cFileShare\Examples\Sampl
      e - AlterPermissions.ps1:  Unexpected token 'server' in expression or statement at line 5 column 18.,Microsoft.Win
      dows.Powershell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
    
    

After:
Invoke-ScriptAnalyzer : Parse error in file C:\Program Files\WindowsPowerShell\Modules\cFileShare\Examples\Sample -
AlterPermissions.ps1: Unexpected token 'server' in expression or statement at line 5 column 18.
At line:1 char:1

  • Invoke-ScriptAnalyzer -Path "C:\Program Files\WindowsPowerShell\Modul ...
  • - CategoryInfo          : ParserError: (UnexpectedToken:String) [Invoke-ScriptAnalyzer], ParseException
    - FullyQualifiedErrorId : Parse error in file C:\Program Files\WindowsPowerShell\Modules\cFileShare\Examples\Sampl
      e - AlterPermissions.ps1:  Unexpected token 'server' in expression or statement at line 5 column 18.,Microsoft.Win
      dows.Powershell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
    

@yutingc
Copy link
Contributor

yutingc commented Apr 9, 2015

Got it. Looks good.

@raghushantha
Copy link
Member Author

thanks

raghushantha added a commit that referenced this pull request Apr 9, 2015
Actionable messages for ast parser errors
@raghushantha raghushantha merged commit 1c0dfc2 into master Apr 9, 2015
@raghushantha raghushantha deleted the Raghu-Changes-1 branch April 10, 2015 20:48
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.

2 participants