Skip to content

Commit d315924

Browse files
author
ladeak
committed
Add error handling for OperationCanceledException
This commit introduces a `try-catch` block in the `Http2Stream` class to handle `OperationCanceledException`. This change ensures that potential cancellation scenarios during shutdown are managed gracefully, preventing disruptions in the program's flow.
1 parent 16a6610 commit d315924

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/CHttpServer/CHttpServer/Http2Stream.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ public async Task CompleteAsync()
415415
_writer.ScheduleEndStream(this);
416416
endStreamWritten = true;
417417
}
418+
catch (OperationCanceledException)
419+
{
420+
// May happen during shutdown.
421+
}
418422
finally
419423
{
420424
if (IsAborted && !endStreamWritten)

0 commit comments

Comments
 (0)