Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,10 @@ private Task ReadFromRowSourceAsync(CancellationToken cts)
{
if (_isAsyncBulkCopy)
{
if (!ADP.IsCatchableExceptionType(ex))
{
throw;
}
return Task.FromException<bool>(ex);
}
else
Expand Down Expand Up @@ -2530,7 +2534,7 @@ private Task CopyColumnsAsync(int col, TaskCompletionSource<object> source = nul
source.SetResult(null);
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down Expand Up @@ -2739,7 +2743,7 @@ private Task CopyRowsAsync(int rowsSoFar, int totalRows, CancellationToken cts,
source.TrySetResult(null); // This is set only on the last call of async copy. But may not be set if everything runs synchronously.
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down Expand Up @@ -2816,7 +2820,7 @@ private Task CopyBatchesAsync(BulkCopySimpleResultSet internalResults, string up
}
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down Expand Up @@ -2888,7 +2892,7 @@ private Task CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults,
return CopyBatchesAsyncContinuedOnSuccess(internalResults, updateBulkCommandText, cts, source);
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down Expand Up @@ -2950,7 +2954,7 @@ private Task CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internal
return source.Task;
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down Expand Up @@ -3122,7 +3126,7 @@ private void WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet int
}
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
_localColumnMappings = null;

Expand Down Expand Up @@ -3299,7 +3303,7 @@ private void WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletio
WriteToServerInternalRestContinuedAsync(internalResults, cts, source); // internalResults is valid here.
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down Expand Up @@ -3376,7 +3380,7 @@ private Task WriteToServerInternalAsync(CancellationToken ctoken)
return resultTask;
}
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
if (source != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private void BeginExecuteReaderInternalReadStage(TaskCompletionSource<object> co
_stateObj.ReadSni(completion);
}
// @TODO: CER Exception Handling was removed here (see GH#3581)
catch (Exception e)
catch (Exception e) when (ADP.IsCatchableExceptionType(e))
{
// Similarly, if an exception occurs put the stateObj back into the pool.
// and reset async cache information to allow a second async execute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private void BeginExecuteXmlReaderInternalReadStage(TaskCompletionSource<object>
_stateObj.ReadSni(completion);
}
// @TODO: CER Exception Handling was removed here (see GH#3581)
catch (Exception e)
catch (Exception e) when (ADP.IsCatchableExceptionType(e))
{
// Similarly, if an exception occurs put the stateObj back into the pool.
// and reset async cache information to allow a second async execute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5476,7 +5476,7 @@ private Task<T> InvokeAsyncCall<T>(SqlDataReaderBaseAsyncCallContext<T> context)
{
task = context.Execute(null, context);
}
catch (Exception ex)
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
task = Task.FromException<T>(ex);
}
Comment thread
cheenamalhotra marked this conversation as resolved.
Expand Down
Loading