From 3350505f88c959f7fd8684030a1185a286f045e5 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Thu, 11 Jul 2019 00:07:21 +0100 Subject: [PATCH] Fix spelling --- .../Core/src/Internal/Http2/Http2OutputProducer.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2OutputProducer.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2OutputProducer.cs index 579cdb2e5a..d692059dff 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2OutputProducer.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2OutputProducer.cs @@ -382,7 +382,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 { if (readResult.Buffer.Length != 0) { - throw new Exception("Http2OutpuProducer.ProcessDataWrites() observed an unexpected state where the streams output ended with data still remaining in the pipe."); + ThrowUnexpectedState(); } // Headers have already been written and there is no other content to write @@ -402,12 +402,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 } catch (Exception ex) { - _log.LogCritical(ex, "Http2OutpuProducer.ProcessDataWrites() observed an unexpected exception."); + _log.LogCritical(ex, nameof(Http2OutputProducer) + "." + nameof(ProcessDataWrites) + " observed an unexpected exception."); } _dataPipe.Reader.Complete(); return flushResult; + + static void ThrowUnexpectedState() + { + throw new InvalidOperationException(nameof(Http2OutputProducer) + "." + nameof(ProcessDataWrites) + " observed an unexpected state where the streams output ended with data still remaining in the pipe."); + } } private Memory GetFakeMemory(int sizeHint)