55 references to TrySetException
mscorlib (1)
system\threading\Tasks\TaskCompletionSource.cs (1)
246if (!TrySetException(exception))
System (7)
net\System\Net\mail\SmtpClient.cs (1)
757if (e.Error != null) tcs.TrySetException(e.Error);
net\System\Net\NetworkInformation\ping.cs (1)
571if (e.Error != null) tcs.TrySetException(e.Error);
net\System\Net\webclient.cs (1)
2916if (e.Error != null) tcs.TrySetException(e.Error);
net\System\Net\WebSockets\WebSocketConnectionStream.cs (2)
908thisPtr.m_WriteTaskCompletionSource.TrySetException(new SocketException(eventArgs.SocketError)); 941thisPtr.m_ReadTaskCompletionSource.TrySetException(new SocketException(eventArgs.SocketError));
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (2)
798thisPtr.m_WriteTaskCompletionSource.TrySetException(eventArgs.Exception); 828thisPtr.m_ReadTaskCompletionSource.TrySetException(eventArgs.Exception);
System.Data (41)
fx\src\data\System\Data\ProviderBase\DbConnectionFactory.cs (2)
274retry.TrySetException(ADP.ExceptionWithStackTrace(ADP.NonPooledOpenTimeout())); 276retry.TrySetException(task.Exception.InnerException);
fx\src\data\System\Data\ProviderBase\DbConnectionPool.cs (2)
1148next.Completion.TrySetException(caughtException); 1151next.Completion.TrySetException(ADP.ExceptionWithStackTrace(ADP.PooledOpenTimeout()));
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (8)
2040source.TrySetException(ex); 2216source.TrySetException(ex); 2274source.TrySetException(ex); 2328source.TrySetException(ex); 2375source.TrySetException(ex); 2541source.TrySetException(ex); 2651source.TrySetException(ex); 2712source.TrySetException(ex);
fx\src\data\System\Data\SqlClient\SqlCommand.cs (12)
1832completion.TrySetException(e); 1837completion.TrySetException(e); 1843completion.TrySetException(e); 1853completion.TrySetException(e); 2213globalCompletion.TrySetException(tsk.Exception.InnerException); 2259globalCompletion.TrySetException(e); 2276globalCompletion.TrySetException(retryTsk.Exception.InnerException); 2287globalCompletion.TrySetException(e2); 2329completion.TrySetException(e); 2334completion.TrySetException(e); 2340completion.TrySetException(e); 2350completion.TrySetException(e);
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (6)
1102networkPacketTaskSource.TrySetException(ADP.ClosedConnectionError()); 4571source.TrySetException(ADP.ExceptionWithStackTrace(ADP.ClosedConnectionError())); 4579exceptionSource.TrySetException(retryTask.Exception.InnerException); 4638source.TrySetException(e.InnerException); 4641source.TrySetException(e); 4664source.TrySetException(e);
fx\src\data\System\Data\SqlClient\SqlSequentialStream.cs (1)
257completion.TrySetException(ex);
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (1)
261completion.TrySetException(ex);
fx\src\data\System\Data\SqlClient\SqlUtil.cs (2)
73completion.TrySetException(exc); 173completion.TrySetException(exc());
fx\src\data\System\Data\SqlClient\TdsParser.cs (1)
1288taskSource.TrySetException(ADP.ExceptionWithStackTrace(exception));
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (6)
2019taskSource.TrySetException(ADP.ExceptionWithStackTrace(ADP.ClosedConnectionError())); 2024taskSource.TrySetException(ADP.ExceptionWithStackTrace(ADP.ClosedConnectionError())); 2087if (source.TrySetException(ex)) { 2536if (source.TrySetException(ex)) { 2571writeCompletionSource.TrySetException(e); 2584writeCompletionSource.TrySetException(delayedException);
System.ServiceModel (1)
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (1)
294tcsObj.TrySetException(antecedent.Exception.InnerException);
System.ServiceModel.Discovery (1)
System\ServiceModel\Discovery\DiscoveryClient.cs (1)
1423this.taskCompletionSource.TrySetException(error);
System.Web (4)
AspNetSynchronizationContextBase.cs (1)
52tcs.TrySetException(ex);
WebSockets\WebSocketPipe.cs (3)
52tcs.TrySetException(ex); // exceptional completion 95tcs.TrySetException(ex); // exceptional completion 153tcs.TrySetException(ex); // exceptional completion