MilvusException

The exception thrown by MilvusClientV2 for errors related to the Milvus client.

public sealed class MilvusException : Exception

A MilvusException carries a MilvusErrorCode describing the error and, for transport-level failures, the underlying gRPC status code.

Constructors

Constructs a MilvusException.

public MilvusException()
public MilvusException(string message)
public MilvusException(string message, Exception innerException)
public MilvusException(MilvusErrorCode errorCode, string reason)
public MilvusException(MilvusErrorCode errorCode, string reason, Exception innerException)
public MilvusException(MilvusErrorCode errorCode, string reason, Grpc.Core.StatusCode grpcStatusCode, Exception innerException)

PARAMETERS:

  • message (string) -

    The error message.

  • innerException (Exception) -

    The exception that caused this exception.

  • errorCode (MilvusErrorCode) -

    The error code.

  • reason (string) -

    The reason reported by the server.

  • grpcStatusCode (Grpc.Core.StatusCode) -

    The underlying gRPC status code.

Properties

  • ErrorCode (MilvusErrorCode) -

    The error code.

  • GrpcStatusCode (Grpc.Core.StatusCode?) -

    The underlying gRPC status code, when this exception wraps a transport-level RpcException. null for server-returned errors.

Example

using Milvus.Client.V2;
using Milvus.Client.V2.Requests.Collection;
using Milvus.Client.V2.Types;

using var client = new MilvusClientV2(new ConnectConfig
{
    Uri = "localhost:19530",
    Username = "root",
    Password = "Milvus"
});

try
{
    await client.DescribeCollectionAsync(new DescribeCollectionReq { CollectionName = "my_collection" });
}
catch (MilvusException e)
{
    Console.WriteLine(e.ErrorCode);
}

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?