Skip to content

Commit 1de7836

Browse files
author
David Bach
committed
Merge remote-tracking branch 'origin/master' into dba-load-csv-from-delve
2 parents fd1ec7c + 0d1fee1 commit 1de7836

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

DelveClientSDK/GeneratedDelveClient.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ public async System.Threading.Tasks.Task<TransactionResult> TransactionAsync(Tra
110110
return objectResponse_.Object;
111111
}
112112
else
113+
if (status_ == 422)
114+
{
115+
var objectResponse_ = await ReadObjectResponseAsync<TransactionResult>(response_, headers_).ConfigureAwait(false);
116+
if (objectResponse_.Object == null)
117+
{
118+
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
119+
}
120+
throw new ApiException<TransactionResult>("The transaction was aborted. The result is wrapped inside a TransactionResult", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
121+
}
122+
else
113123
if (status_ == 403)
114124
{
115125
var objectResponse_ = await ReadObjectResponseAsync<InfraError>(response_, headers_).ConfigureAwait(false);

DelveClientSDKTests/IntegrationTestsCommons.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public static void RunAllTests(ConnFunc connFunc)
7070
// create_database
7171
// =============================================================================
7272
Assert.IsTrue(conn.CreateDatabase(overwrite: true));
73-
Assert.Throws<Exception>(() => conn.CreateDatabase());
73+
var ex1 = Assert.Throws<AggregateException>(() => conn.CreateDatabase());
74+
Assert.AreEqual(typeof(ApiException<TransactionResult>), ex1.InnerException.GetType());
7475

7576
// install_source
7677
// =============================================================================
@@ -168,7 +169,9 @@ public static void RunAllTests(ConnFunc connFunc)
168169
queryResEquals(conn3.Query(output: "x"), ToRelData( 1L, 2L, 3L, 4L ));
169170

170171
// Try to clone from conn to conn2, without passing overwrite=true
171-
Assert.Throws<Exception>(() => conn2.CloneDatabase(conn));
172+
var ex2 = Assert.Throws<AggregateException>(() => conn2.CloneDatabase(conn));
173+
Assert.AreEqual(typeof(ApiException<TransactionResult>), ex2.InnerException.GetType());
174+
172175
queryResEquals(conn.Query(output: "x"), ToRelData( 1L, 2L, 3L, 4L ));
173176
queryResEquals(conn2.Query(output: "x"), ToRelData( 1L, 2L, 3L, 5L ));
174177
queryResEquals(conn3.Query(output: "x"), ToRelData( 1L, 2L, 3L, 4L ));

0 commit comments

Comments
 (0)