Details
-
Improvement
-
Resolution: Fixed
-
Major
-
3.2.4
-
None
-
1
-
SDK16: SDK 3.3 + Spring Txns
Description
static async Task Main(string[] args) |
{
|
try |
{
|
var cluster = await Couchbase.Cluster.ConnectAsync("couchbase://localhost", "Administrator", "password"); |
var queryResult = await cluster.QueryAsync<dynamic>("select * from `travel- sample`.inventory.airport limit 2"); |
await foreach (var row in queryResult)
|
{
|
Console.WriteLine(row);
|
}
|
|
}
|
catch (CouchbaseException ex) |
{
|
Console.WriteLine(ex);
|
|
}
|
catch (Exception ex) |
{
|
Console.WriteLine(ex);
|
|
}
|
Console.Read();
|
}
|
|
The code above works as expected. However if you provide an incorrect password the exception thrown is ServiceNotAvailableException, instead it should be AuthenticationFailedException
Couchbase.ServiceNotAvailableException: Service n1ql not available.
|
at Couchbase.Core.ClusterContext.GetRandomNodeForService(ServiceType service, String bucketName)
|
at Couchbase.Core.ServiceUriProvider.GetRandomQueryUri()
|
at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, ITypeSerializer serializer, IRequestSpan span)
|
at Couchbase.Query.QueryClient.QueryAsync[T](String statement, QueryOptions options)
|
at Couchbase.Cluster.<>c__DisplayClass33_0`1.<<QueryAsync>g__Func|0>d.MoveNext() |
--- End of stack trace from previous location where exception was thrown ---
|
at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync[T](Func`1 send, IRequest request) |
at Couchbase.Cluster.QueryAsync[T](String statement, QueryOptions options)
|
at ScopeLevelQuery.Program.Main(String[] args) in /Users/arun.vijayraghavan/ScopeLevelQuery/ScopeLevelQuery/Program.cs:line 24 |