129 references to Exception
dotnet-svcutil-lib (10)
FrameworkFork\Microsoft.Xml\Xml\AsyncHelper.cs (1)
27return task.IsCompleted && task.Exception == null;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (3)
23throw Fx.Exception.AsError<TException>(task.Exception); 60if (antecedent.IsFaulted) tcsObj.TrySetException(antecedent.Exception.InnerException); 109tcsObj.TrySetException(antecedent.Exception.InnerException);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (2)
193throw FxTrace.Exception.AsError<CommunicationException>(task.Exception); 206return FxTrace.Exception.AsError<CommunicationException>(task.Exception);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (4)
83Fx.Assert(invokeTask.Exception != null, "Task.IsFaulted guarantees non-null exception."); 84ae = invokeTask.Exception; 94Fx.Assert(task.Exception != null, "Task.IsFaulted guarantees non-null exception."); 95ae = task.Exception;
Microsoft.AspNetCore.Components (5)
ErrorBoundaryBase.cs (1)
98ExceptionDispatchInfo.Capture(onExceptionTask.Exception!).Throw();
RenderTree\Renderer.cs (4)
593var baseException = task.Exception.GetBaseException(); 823HandleException(updateDisplayTask.Exception); 870HandleException(updateDisplayTask.Exception); 914HandleExceptionViaErrorBoundary(task.Exception, state);
Microsoft.AspNetCore.Components.Authorization.Tests (2)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (1)
85var exception = task.Exception.Flatten().InnerException;
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
ImportMapTest.cs (1)
318var exception = task.Exception.Flatten().InnerException;
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
Microsoft.AspNetCore.Components.Forms.Tests (2)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (1)
85var exception = task.Exception.Flatten().InnerException;
Microsoft.AspNetCore.Components.Tests (3)
RendererTest.cs (1)
5211var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (1)
85var exception = task.Exception.Flatten().InnerException;
Microsoft.AspNetCore.Components.Web (2)
HtmlRendering\StaticHtmlRenderer.cs (2)
75ExceptionDispatchInfo.Capture(quiescenceTask.Exception.InnerException ?? quiescenceTask.Exception).Throw();
Microsoft.AspNetCore.Components.Web.Tests (2)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (1)
85var exception = task.Exception.Flatten().InnerException;
Microsoft.AspNetCore.Components.WebAssembly (2)
Rendering\WebAssemblyDispatcher.cs (2)
102state.tcs.SetException(t.Exception); 146state.tcs.SetException(t.Exception);
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingProvider.cs (2)
410static t => _ = t.Exception, // Still observe the exception - just don't throw it 426throw Error.KeyRingProvider_RefreshFailedOnOtherThread(existingTask.Exception);
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionContext.cs (2)
341Transport?.Output.Complete(applicationTask.Exception?.InnerException); 366Application?.Output.Complete(transportTask.Exception?.InnerException);
Internal\HttpConnectionDispatcher.cs (1)
264connection.Transport.Output.Complete(connection.ApplicationTask.Exception);
Microsoft.AspNetCore.Http.Connections.Client (2)
Internal\LongPollingTransport.cs (1)
98_error = sending.IsFaulted ? sending.Exception!.InnerException : null;
Internal\ServerSentEventsTransport.cs (1)
115_error = sending.IsFaulted ? sending.Exception!.InnerException : null;
Microsoft.AspNetCore.OutputCaching.Tests (1)
CachedResponseBodyTests.cs (1)
36var copyTask = RecyclableReadOnlySequenceSegment.CopyToAsync(body, pipe.Writer, cts.Token).AsTask().ContinueWith(t => pipe.Writer.CompleteAsync(t.Exception));
Microsoft.AspNetCore.Owin (1)
WebSockets\OwinWebSocketAcceptAdapter.cs (1)
90_requestTcs.TrySetException(task.Exception);
Microsoft.AspNetCore.SignalR.Client.Core (4)
HubConnection.cs (2)
614static t => _ = t.Exception, 697_ = reader.Completion.Exception;
HubConnectionExtensions.StreamAsChannelAsync.cs (1)
316_ = inputChannel.Completion.Exception;
src\SignalR\common\Shared\MessageBuffer.cs (1)
294_ = tcs.Task.Exception;
Microsoft.AspNetCore.SignalR.Core (1)
src\SignalR\common\Shared\MessageBuffer.cs (1)
294_ = tcs.Task.Exception;
Microsoft.CodeAnalysis (1)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
720var innerException = faultedTask.Exception?.InnerException;
Microsoft.CodeAnalysis.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (4)
581RoslynDebug.AssertNotNull(task.Exception); 582if (task.Exception.InnerExceptions.Count > 0) 583this.TrySetException(task.Exception.InnerExceptions); 585this.TrySetException(task.Exception);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
100static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
73var exception = task.Exception!; 89task.ContinueWith(p => FatalError.ReportAndCatchUnlessCanceled(p.Exception!), 99task.ContinueWith(p => FatalError.ReportAndCatchUnlessCanceled(p.Exception!, cancellationToken),
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (3)
ScriptTests.cs (3)
243Assert.Null(state.Exception); 250Assert.Null(state.Exception); 260Assert.Null(state.Exception);
Microsoft.CodeAnalysis.InteractiveHost (7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (4)
581RoslynDebug.AssertNotNull(task.Exception); 582if (task.Exception.InnerExceptions.Count > 0) 583this.TrySetException(task.Exception.InnerExceptions); 585this.TrySetException(task.Exception);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
73var exception = task.Exception!; 89task.ContinueWith(p => FatalError.ReportAndCatchUnlessCanceled(p.Exception!), 99task.ContinueWith(p => FatalError.ReportAndCatchUnlessCanceled(p.Exception!, cancellationToken),
Microsoft.CodeAnalysis.Workspaces (10)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (2)
181if (task.Exception != null) 183throw task.Exception;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (4)
581RoslynDebug.AssertNotNull(task.Exception); 582if (task.Exception.InnerExceptions.Count > 0) 583this.TrySetException(task.Exception.InnerExceptions); 585this.TrySetException(task.Exception);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
100static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
73var exception = task.Exception!; 89task.ContinueWith(p => FatalError.ReportAndCatchUnlessCanceled(p.Exception!), 99task.ContinueWith(p => FatalError.ReportAndCatchUnlessCanceled(p.Exception!, cancellationToken),
Microsoft.Extensions.Hosting (3)
Internal\Host.cs (3)
337if (task.Exception is not null) 339exceptions.AddRange(task.Exception.InnerExceptions); // Log exception from async method. 366exceptions.AddRange(groupedTasks.Exception.InnerExceptions);
Microsoft.JSInterop (2)
Infrastructure\DotNetDispatcher.cs (2)
144if (task.Exception != null) 146var exceptionDispatchInfo = ExceptionDispatchInfo.Capture(task.Exception.GetBaseException());
Microsoft.JSInterop.Tests (1)
JSRuntimeTest.cs (1)
201var exception = Assert.IsType<AggregateException>(task.AsTask().Exception);
Microsoft.Maui.Controls (1)
NavigationPage\NavigationPage.cs (1)
412 throw t.Exception;
Microsoft.Maui.Resizetizer (2)
AsyncTask.cs (2)
66 if (task.Exception != null) 68 var ex = task.Exception.GetBaseException();
System.Data.Odbc (1)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
112retry.TrySetException(task.Exception!.InnerException!);
System.Net.Http (4)
System\Net\Http\MessageProcessingHandler.cs (1)
68sendState.TrySetException(task.Exception!.GetBaseException());
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (2)
154Trace($"{nameof(QuicConnection)} failed to close: {closeTask.Exception!.InnerException}"); 481if (t.Exception?.InnerException is QuicException ex && ex.QuicError == QuicError.StreamAborted)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
210Exception? e = task.Exception!.InnerException; // Access Exception even if not tracing, to avoid TaskScheduler.UnobservedTaskException firing
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
133Exception? ex = t.Exception?.InnerException;
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.cs (1)
527var e = new PingCompletedEventArgs(t.IsCompletedSuccessfully ? t.Result : null, t.Exception, t.IsCanceled, asyncOp.UserSuppliedState);
System.Net.Quic (4)
System\Net\Quic\QuicConnection.cs (3)
664_ = _connectionCloseTcs.Task.Exception; 675_ = _connectionCloseTcs.Task.Exception; 689_ = _connectionCloseTcs.Task.Exception;
System\Net\Quic\QuicListener.cs (1)
300if (task.AsTask().Exception?.InnerException is Exception handshakeException)
System.Net.Sockets (2)
System\Net\Sockets\Socket.cs (2)
4062Debug.Assert(t.Exception != null); 4063return t.Exception.InnerException switch
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (1)
165Exception e = task.Exception!.InnerException!;
System.Private.CoreLib (9)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (1)
161throw task.Exception!;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (3)
230Debug.Assert(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception!.InnerExceptionCount > 0, 234AggregateException faultedException = faultedTask.Exception; 648_ = t.Exception;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (1)
1429public Exception? Exception => m_task.Exception;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (4)
1246/// or in accesses to the <see cref="Exception"/> property. Any exceptions not observed by the time 1521/// <see cref="Exception"/> property will be non-null. 1523[MemberNotNullWhen(true, nameof(Exception))] 7149public Exception? Exception => m_task.Exception;
System.ServiceModel.Federation (2)
System\Runtime\TaskHelpers.cs (2)
48tcsObj.TrySetException(antecedent.Exception.InnerException); 104tcsObj.TrySetException(antecedent.Exception.InnerException);
System.ServiceModel.Primitives.Tests (1)
ServiceModel\ThrowingOnCloseBindingElement.cs (1)
166tcs.TrySetException(task.Exception.InnerExceptions);
System.Threading.Channels (1)
System\Threading\Channels\ChannelUtilities.cs (1)
44_ = tcs.Task.Exception;
System.Threading.Tasks.Dataflow (20)
Base\DataflowBlock.cs (3)
2034Common.AddException(ref exceptions, task.Exception!, unwrapInnerExceptions: true); 2295sourceCompletionTask.Exception : null; 2470static (t, state) => ((ObserversState)state!).NotifyObserversOfCompletion(t.Exception!), this,
Blocks\ActionBlock.cs (1)
213_defaultTarget.Complete(completed.Exception, dropPendingMessages: true, storeExceptionEvenIfAlreadyCompleting: true, unwrapInnerExceptions: true);
Blocks\BatchBlock.cs (1)
85thisBlock.Fault(completed.Exception!);
Blocks\BatchedJoinBlock.cs (2)
103thisBlock.Fault(completed.Exception!); 355thisBlock.Fault(completed.Exception!);
Blocks\BroadcastBlock.cs (1)
95thisBlock.Fault(completed.Exception!);
Blocks\BufferBlock.cs (1)
77thisBlock.Fault(completed.Exception!);
Blocks\JoinBlock.cs (2)
99thisBlock.Fault(completed.Exception!); 324thisBlock.Fault(completed.Exception!);
Blocks\TransformBlock.cs (3)
146if (completed.IsFaulted) sourceCore.AddAndUnwrapAggregateException(completed.Exception!); 158thisBlock.Fault(completed.Exception!); 290AggregateException aggregate = completed.Exception!;
Blocks\TransformManyBlock.cs (3)
142if (completed.IsFaulted) sourceCore.AddAndUnwrapAggregateException(completed.Exception!); 154thisBlock.Fault(completed.Exception!); 286AggregateException aggregate = completed.Exception!;
Internal\Common.cs (2)
487_ = task.Exception; 552AggregateException? exception = sourceCompletionTask.IsFaulted ? sourceCompletionTask.Exception : null;
Internal\DataflowEtwProvider.cs (1)
143try { exceptionData = string.Join(Environment.NewLine, completionTask.Exception!.InnerExceptions.Select(static e => e.ToString())); }