Skip to content

Commit 6e6d4f5

Browse files
authored
Get rid of an unreachable code warning (.NET Core)
1 parent 7893956 commit 6e6d4f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Serilog.Sinks.File/FileLoggerConfigurationExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ static LoggerConfiguration ConfigureFile(
178178

179179
if (shared)
180180
{
181-
#if !ATOMIC_APPEND
182-
throw new NotSupportedException("File sharing is not supported on this platform.");
183-
#endif
184-
181+
#if ATOMIC_APPEND
185182
if (buffered)
186183
throw new ArgumentException("Buffered writes are not available when file sharing is enabled.", nameof(buffered));
184+
#else
185+
throw new NotSupportedException("File sharing is not supported on this platform.");
186+
#endif
187187
}
188188

189189
ILogEventSink sink;
@@ -215,4 +215,4 @@ static LoggerConfiguration ConfigureFile(
215215
return addSink(sink, restrictedToMinimumLevel, levelSwitch);
216216
}
217217
}
218-
}
218+
}

0 commit comments

Comments
 (0)