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

Don't throw UvException directly to users #299

Closed
Tratcher opened this issue Oct 28, 2015 · 3 comments
Closed

Don't throw UvException directly to users #299

Tratcher opened this issue Oct 28, 2015 · 3 comments
Assignees
Milestone

Comments

@Tratcher
Copy link
Member

Kestrel request and response Streams should throw IOExceptions, not UvExceptions.

An exception of type 'Microsoft.AspNet.Server.Kestrel.Networking.UvException' occurred in mscorlib.dll but was not handled in user code

Additional information: Error -4081 ECANCELED operation canceled

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.Server.Kestrel.Http.Frame.<WriteChunkedAsync>d__88.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.Server.Kestrel.Http.Frame.<WriteAsync>d__86.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Glimpse.Server.Resources.ServerSentEventResponse.<SendData>d__5.MoveNext() in C:\Users\antho\Projects\Glimpse.Prototype\src\Glimpse.Server\Resources\HttpContextExtensions.cs:line 100
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Glimpse.Server.Internal.Resources.MessageStreamResource.<>c__DisplayClass4_0.<<Configure>b__1>d.MoveNext() in C:\Users\antho\Projects\Glimpse.Prototype\src\Glimpse.Server\Internal\Resources\MessageStreamResource.cs:line 63
https://github.com/Glimpse/Glimpse.Prototype/blob/dev/src/Glimpse.Server/Internal/Resources/MessageStreamResource.cs#L63
@Tratcher Tratcher added the bug label Oct 28, 2015
@halter73 halter73 added this to the 1.0.0-rc2 milestone Nov 6, 2015
@halter73 halter73 self-assigned this Nov 6, 2015
@halter73
Copy link
Member

Fixed by #325

@omuleanu
Copy link

I'm also getting this in rc1-final while debugging,
"An exception of type 'Microsoft.AspNet.Server.Kestrel.Networking.UvException' occurred in mscorlib.dll but was not handled in user code

Additional information: Error -4077 ECONNRESET connection reset by peer"
on line writer.Write(str) in WriteTo method, custom helper, implements IHtmlContent

@halter73
Copy link
Member

Response.Write will no longer throw in RC2 unless you pass in a canceled CancellationToken (such as `RequestAborted). In RC1, writes can fail if there are connection issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants