@@ -274,21 +274,19 @@ private void AnalyzeFile(string filePath)
274
274
ErrorCategory . InvalidArgument , filePath ) ) ;
275
275
}
276
276
277
- if ( errors != null && errors . Length > 0 )
277
+ if ( errors != null && errors . Length > 0 )
278
278
{
279
279
foreach ( ParseError error in errors )
280
280
{
281
- WriteError ( new ErrorRecord ( new ParseException ( ) ,
282
- String . Format ( CultureInfo . CurrentCulture , Strings . ParserErrorFormat , error . Extent . File , error . Message . TrimEnd ( '.' ) , error . Extent . StartLineNumber , error . Extent . StartColumnNumber ) ,
283
- ErrorCategory . ParserError , error . ErrorId ) ) ;
281
+ string parseErrorMessage = String . Format ( CultureInfo . CurrentCulture , Strings . ParserErrorFormat , error . Extent . File , error . Message . TrimEnd ( '.' ) , error . Extent . StartLineNumber , error . Extent . StartColumnNumber ) ;
282
+ WriteError ( new ErrorRecord ( new ParseException ( parseErrorMessage ) , parseErrorMessage , ErrorCategory . ParserError , error . ErrorId ) ) ;
284
283
}
285
284
}
286
285
287
286
if ( errors . Length > 10 )
288
287
{
289
- WriteError ( new ErrorRecord ( new ParseException ( ) ,
290
- String . Format ( CultureInfo . CurrentCulture , Strings . ParserErrorMessage , System . IO . Path . GetFileName ( filePath ) ) ,
291
- ErrorCategory . ParserError , filePath ) ) ;
288
+ string manyParseErrorMessage = String . Format ( CultureInfo . CurrentCulture , Strings . ParserErrorMessage , System . IO . Path . GetFileName ( filePath ) ) ;
289
+ WriteError ( new ErrorRecord ( new ParseException ( manyParseErrorMessage ) , manyParseErrorMessage , ErrorCategory . ParserError , filePath ) ) ;
292
290
293
291
return ;
294
292
}
0 commit comments