Skip to content

Commit 20eaa50

Browse files
committed
Adds handling for OperationCanceledException
1 parent 26330df commit 20eaa50

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/https/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ public async Task<int> RunAsync(string[] args)
324324
renderer.WriteException(ex);
325325
return 1;
326326
}
327+
catch (OperationCanceledException ex)
328+
{
329+
renderer.WriteException(ex);
330+
return 1;
331+
}
327332
catch (HttpRequestException ex)
328333
{
329334
renderer.WriteException(ex);
@@ -580,7 +585,7 @@ ExceptionHelp WriteException(Exception ex, int depth)
580585
_info.WriteLine(ex.Message);
581586

582587
var exceptionHelp = ExceptionHelp.None;
583-
if (ex is TaskCanceledException)
588+
if (ex is TaskCanceledException || ex is OperationCanceledException)
584589
{
585590
return ExceptionHelp.Timeout;
586591
}

0 commit comments

Comments
 (0)