import IndexError from "./IndexError.js";
/**
 * Error thrown when a shard fails to load.
 *
 * This error indicates that a shard file could not be read or parsed,
 * typically due to I/O errors, missing files, or permission issues.
 */
export default class ShardLoadError extends IndexError {
    shardPath;
    oid;
    constructor(message, options = {}) {
        const context = {
            ...options.context,
            shardPath: options.shardPath,
            oid: options.oid,
        };
        super(message, {
            code: 'SHARD_LOAD_ERROR',
            context,
        });
        this.shardPath = options.shardPath;
        this.oid = options.oid;
        this.cause = options.cause;
    }
}
