Skip to content

Commit f683b72

Browse files
committed
Add an exit statement and use logger to log errors to the console
1 parent 37ecce2 commit f683b72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ internal static async Task ValidateOpenApiDocument(string openapi, LogLevel logl
353353
foreach (var error in context.Errors)
354354
{
355355
logger.LogError("OpenApi Parsing error: {message}", error.ToString());
356-
Console.WriteLine(error.ToString());
357356
}
358357
}
359358

@@ -362,7 +361,7 @@ internal static async Task ValidateOpenApiDocument(string openapi, LogLevel logl
362361
walker.Walk(document);
363362

364363
logger.LogTrace("Finished walking through the OpenApi document. Generating a statistics report..");
365-
Console.WriteLine(statsVisitor.GetStatisticsReport());
364+
logger.LogInformation(statsVisitor.GetStatisticsReport());
366365
}
367366
catch(Exception ex)
368367
{
@@ -371,6 +370,7 @@ internal static async Task ValidateOpenApiDocument(string openapi, LogLevel logl
371370
#else
372371
logger.LogCritical(ex.Message);
373372
#endif
373+
return;
374374
}
375375

376376
}

0 commit comments

Comments
 (0)