Skip to content

Commit 5e52cc1

Browse files
committed
fix issues
1 parent 924da51 commit 5e52cc1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Ydb.Sdk/src/Ado/YdbConnection.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Data.Common;
33
using System.Diagnostics.CodeAnalysis;
44
using Ydb.Operations;
5+
using Ydb.Sdk.Ado.Internal;
56
using Ydb.Sdk.Ado.Session;
67
using Ydb.Sdk.Services.Query;
78
using Ydb.Sdk.Value;
@@ -83,8 +84,7 @@ public async Task BulkUpsertAsync(
8384
var req = new BulkUpsertRequest
8485
{
8586
Table = tablePath,
86-
Rows = list.GetProto(),
87-
OperationParams = new OperationParams()
87+
Rows = list.GetProto()
8888
};
8989

9090
if (Session is Services.Query.Session sessionImpl)
@@ -94,8 +94,12 @@ public async Task BulkUpsertAsync(
9494
req,
9595
new GrpcRequestSettings { CancellationToken = cancellationToken }
9696
).ConfigureAwait(false);
97-
var status = Status.FromProto(resp.Operation.Status, resp.Operation.Issues);
98-
status.EnsureSuccess();
97+
98+
var operation = resp.Operation;
99+
if (operation.Status.IsNotSuccess())
100+
{
101+
throw YdbException.FromServer(operation.Status, operation.Issues);
102+
}
99103
}
100104
else
101105
{

0 commit comments

Comments
 (0)