Skip to content

Commit

Permalink
fix:change TException to Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lausannel committed Jul 7, 2024
1 parent a6859d3 commit 8201c08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public async Task Test()
{
await TestOpenWithNodeUrls();

await TestOpenWith2NodeUrls();

await TestOpenWithNodeUrlsAndInsertOneRecord();

await TestInsertOneRecord();
Expand Down Expand Up @@ -128,6 +130,21 @@ public async Task TestOpenWithNodeUrls()
await session_pool.Close();
Console.WriteLine("TestOpenWithNodeUrls Passed!");
}
public async Task TestOpenWith2NodeUrls()
{
var session_pool = new SessionPool(new List<string>() { host + ":" + port, host + ":" + (port + 1) }, 8);
await session_pool.Open(false);
Debug.Assert(session_pool.IsOpen());
if (debug) session_pool.OpenDebugMode();
await session_pool.Close();

session_pool = new SessionPool(new List<string>() { host + ":" + (port + 1), host + ":" + port }, 8);
await session_pool.Open(false);
Debug.Assert(session_pool.IsOpen());
if (debug) session_pool.OpenDebugMode();
await session_pool.Close();
Console.WriteLine("TestOpenWith2NodeUrls Passed!");
}
public async Task TestOpenWithNodeUrlsAndInsertOneRecord()
{
var session_pool = new SessionPool(node_urls, 8);
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.IoTDB/SessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public async Task Open(CancellationToken cancellationToken = default)
}
break;
}
catch (TException e)
catch (Exception e) // CreateAndOpen will not throw TException

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used

Check warning on line 198 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The variable 'e' is declared but never used
{
#if NET461_OR_GREATER || NETSTANDARD2_0
#else
Expand Down

0 comments on commit 8201c08

Please sign in to comment.