Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
-
1
-
SDK20: Pathfinding + Wrappers
Description
While trying a simple code as given below BucketNotFound Exception was thrown which is very confusing when the actual problem was in the connection string where the user passed in localhosts instead of localhost. This should fall into TimeoutException with appropriate error message.
In another instance where localhost was passed but an incorrect password was supplied. BucketNotFoundException was thrown, once again this should be AuthenticationFailedException instead.BucketNotFoundException tells the user that everything with connection was ok but just that the bucket name was incorrectly supplied or bucket doesn't exist but thats not the actual case here.
Additionally trying to catch a CouchbaseException didn't work either. As you see in the code user had to catch an Exception object instead.
try
|
{
|
var cluster = await Couchbase.Cluster.ConnectAsync("couchbase://localhosts", "Administrator", "password"); |
var bucket = await cluster.BucketAsync("travel-sample"); |
|
Console.Read();
|
}catch(Exception ex) |
{
|
Console.WriteLine(ex);
|
Console.Read();
|
|
}
|