import IndexError from "./IndexError.js";
/**
 * Error thrown when shard data is corrupted or invalid.
 *
 * This error indicates that a shard file contains invalid or corrupted data,
 * such as invalid checksums, unsupported versions, or malformed content.
 */
export default class ShardCorruptionError extends IndexError {
    shardPath;
    oid;
    reason;
    constructor(message, options = {}) {
        const context = {
            ...options.context,
            shardPath: options.shardPath,
            oid: options.oid,
            reason: options.reason,
        };
        super(message, {
            code: 'SHARD_CORRUPTION_ERROR',
            context,
        });
        this.shardPath = options.shardPath;
        this.oid = options.oid;
        this.reason = options.reason;
    }
}
