Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 8f3d894

Browse files
author
Justin Kotalik
committed
#625 Changes Error Message when trying to reuse stream
1 parent 3865136 commit 8f3d894

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.AspNetCore.WebUtilities/MultipartReaderStream.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public override int Read(byte[] buffer, int offset, int count)
226226
PositionInnerStream();
227227
if (!_innerStream.EnsureBuffered(_boundary.FinalBoundaryLength))
228228
{
229-
throw new IOException("Unexpected end of stream.");
229+
throw new IOException("Unexpected end of Stream, the content may have already been read by another component. ");
230230
}
231231
var bufferedData = _innerStream.BufferedData;
232232

@@ -280,7 +280,7 @@ public override async Task<int> ReadAsync(byte[] buffer, int offset, int count,
280280
PositionInnerStream();
281281
if (!await _innerStream.EnsureBufferedAsync(_boundary.FinalBoundaryLength, cancellationToken))
282282
{
283-
throw new IOException("Unexpected end of stream.");
283+
throw new IOException("Unexpected end of Stream, the content may have already been read by another component. ");
284284
}
285285
var bufferedData = _innerStream.BufferedData;
286286

0 commit comments

Comments
 (0)