81 references to Exception
Microsoft.AspNetCore.Components (5)
ErrorBoundaryBase.cs (1)
98ExceptionDispatchInfo.Capture(onExceptionTask.Exception!).Throw();
RenderTree\Renderer.cs (4)
584var baseException = task.Exception.GetBaseException(); 814HandleException(updateDisplayTask.Exception); 861HandleException(updateDisplayTask.Exception); 905HandleExceptionViaErrorBoundary(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 (1)
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)
116_error = sending.IsFaulted ? sending.Exception!.InnerException : null;
Microsoft.AspNetCore.OutputCaching.Tests (1)
CachedResponseBodyTests.cs (1)
35var 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)
600static t => _ = t.Exception, 683_ = 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.Extensions.Hosting (3)
Internal\Host.cs (3)
338if (task.Exception is not null) 340exceptions.AddRange(task.Exception.InnerExceptions); // Log exception from async method. 363exceptions.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)
195var exception = Assert.IsType<AggregateException>(task.AsTask().Exception);
System.Net.Http (6)
System\Net\Http\MessageProcessingHandler.cs (1)
68sendState.TrySetException(task.Exception!.GetBaseException());
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (2)
140Trace($"{nameof(QuicConnection)} failed to close: {closeTask.Exception!.InnerException}"); 388if (t.Exception?.InnerException is QuicException ex && ex.QuicError == QuicError.StreamAborted)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (3)
179_ = task.AsTask().Exception; 184task.AsTask().ContinueWith(static t => _ = t.Exception, 208Exception? e = task.Exception!.InnerException; // Access Exception even if not tracing, to avoid TaskScheduler.UnobservedTaskException firing
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
129Exception? 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 (1)
System\Net\Quic\QuicListener.cs (1)
262Exception ex = task.AsTask().Exception!.InnerException!;
System.Net.Sockets (2)
System\Net\Sockets\Socket.cs (2)
3890Debug.Assert(t.Exception != null); 3891return t.Exception.InnerException switch
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
599t.AsTask().ContinueWith(static p => { _ = p.Exception; },
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)
1245/// or in accesses to the <see cref="Exception"/> property. Any exceptions not observed by the time 1520/// <see cref="Exception"/> property will be non-null. 1522[MemberNotNullWhen(true, nameof(Exception))] 7084public Exception? Exception => m_task.Exception;
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())); }