/// Errors returned by the QuicProQuo SDK.
public enum QpqError: Error, Sendable, CustomStringConvertible {
    /// Connection to the server failed.
    case connectionFailed(String)
    /// OPAQUE authentication failed (bad credentials).
    case authFailed(String)
    /// The operation timed out.
    case timeout(String)
    /// The client is not connected.
    case notConnected
    /// A generic error from the FFI layer.
    case ffiError(String)

    public var description: String {
        switch self {
        case .connectionFailed(let msg): return "connection failed: \(msg)"
        case .authFailed(let msg): return "auth failed: \(msg)"
        case .timeout(let msg): return "timeout: \(msg)"
        case .notConnected: return "not connected"
        case .ffiError(let msg): return "FFI error: \(msg)"
        }
    }
}
