using Robotico.Result.Errors;
namespace Robotico.Nexus.Client;
/// Stable error codes for .
public static class NexusErrors
{
/// General Nexus client failure.
public const string Code = "NXS_NEXUS";
/// Connection URI failed to parse or uses an unsupported form.
public const string UriInvalid = "NXS_URI_INVALID";
/// Connection URI scheme is recognized but not supported by this client.
public const string UnsupportedScheme = "NXS_URI_UNSUPPORTED_SCHEME";
/// The gRPC channel could not be created (TLS material, address, or transport failure).
public const string ConnectFailed = "NXS_CONNECT_FAILED";
/// TLS/mTLS material was rejected or missing required files.
public const string TlsRejected = "NXS_TLS_REJECTED";
/// Create was called for a database that already answers to Ping.
public const string AlreadyExists = "NXS_ALREADY_EXISTS";
/// Requested resource was not found on the remote engine.
public const string NotFound = "NXS_NOT_FOUND";
/// Invalid argument (empty name, bad range, unknown wire type).
public const string InvalidArgument = "NXS_INVALID_ARGUMENT";
/// Operation attempted on a disposed client/session.
public const string Disposed = "NXS_DISPOSED";
/// Remote engine is unreachable or the call exceeded its deadline.
public const string Unavailable = "NXS_UNAVAILABLE";
/// Generic wire/gRPC failure not covered by a more specific code.
public const string WireFailed = "NXS_WIRE_FAILED";
/// Creates a with .
public static SimpleError Error(string message) => new(message, Code);
/// Creates a with an explicit code.
public static SimpleError Error(string message, string code) => new(message, code);
}