Skip to content

Commit 37ecce2

Browse files
committed
Clean up code
1 parent 7128fb2 commit 37ecce2

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,18 @@ CancellationToken cancellationToken
4949
{
5050
if (string.IsNullOrEmpty(openapi) && string.IsNullOrEmpty(csdl))
5151
{
52-
throw new ArgumentNullException("Please input a file path");
52+
throw new ArgumentException("Please input a file path");
5353
}
54-
}
55-
catch (ArgumentNullException ex)
56-
{
57-
#if DEBUG
58-
logger.LogCritical(ex, ex.Message);
59-
#else
60-
logger.LogCritical(ex.Message);
61-
#endif
62-
return;
63-
}
64-
try
65-
{
6654
if(output == null)
6755
{
68-
throw new ArgumentException(nameof(output));
56+
throw new ArgumentNullException(nameof(output));
6957
}
70-
}
71-
catch (ArgumentException ex)
72-
{
73-
#if DEBUG
74-
logger.LogCritical(ex, ex.Message);
75-
#else
76-
logger.LogCritical(ex.Message);
77-
#endif
78-
return;
79-
}
80-
try
81-
{
8258
if (output.Exists)
8359
{
8460
throw new IOException($"The file {output} already exists. Please input a new file path.");
8561
}
8662
}
87-
catch (IOException ex)
63+
catch (Exception ex)
8864
{
8965
#if DEBUG
9066
logger.LogCritical(ex, ex.Message);

0 commit comments

Comments
 (0)