export class NeuroLinkFeatureError extends Error {
    code;
    feature;
    retryable;
    details;
    cause;
    constructor(message, code, feature, options) {
        super(message);
        this.name = `${feature}Error`;
        this.code = code;
        this.feature = feature;
        this.retryable = options?.retryable ?? false;
        this.details = options?.details;
        this.cause = options?.cause;
    }
}
export function createErrorFactory(feature, codes) {
    return {
        codes,
        create: (code, message, options) => new NeuroLinkFeatureError(message, codes[code], feature, options),
    };
}
