[corlib] Mark all promise-style task exceptions observed. Fixes #17015
[mono.git] / mcs / class / corlib / System.Runtime.CompilerServices / AsyncTaskMethodBuilder.cs
index 13a7f218fee1619f18d755b09a5882b01e5e7d10..cdb7a33db19c85573c2e4164f11b3404413d4239 100644 (file)
@@ -76,7 +76,7 @@ namespace System.Runtime.CompilerServices
                
                public void SetException (Exception exception)
                {
-                       if (Task.TrySetException (new AggregateException (exception), exception is OperationCanceledException))
+                       if (Task.TrySetException (new AggregateException (exception), exception is OperationCanceledException, true))
                                return;
 
                        throw new InvalidOperationException ("The task has already completed");