import IndexError from "./IndexError.js";
/**
 * Error thrown when shard validation fails.
 *
 * This error indicates that a shard file failed validation checks,
 * where expected values do not match actual values for specific fields.
 */
export default class ShardValidationError extends IndexError {
    shardPath;
    expected; // nosemgrep: ts-no-unknown-outside-adapters -- 0025B
    actual; // nosemgrep: ts-no-unknown-outside-adapters -- 0025B
    field;
    constructor(message, options = {}) {
        const context = {
            ...options.context,
            shardPath: options.shardPath,
            expected: options.expected,
            actual: options.actual,
            field: options.field,
        };
        super(message, {
            code: 'SHARD_VALIDATION_ERROR',
            context,
        });
        this.shardPath = options.shardPath;
        this.expected = options.expected;
        this.actual = options.actual;
        this.field = options.field;
    }
}
