import IndexError from "./IndexError.js";
/**
 * Error thrown when a storage operation fails.
 *
 * StorageError extends IndexError because storage errors originate from
 * index operations. This hierarchy is intentional -- IndexError provides
 * the storage-specific error context.
 */
export default class StorageError extends IndexError {
    operation;
    oid;
    constructor(message, options = {}) {
        const context = {
            ...options.context,
            operation: options.operation,
            oid: options.oid,
        };
        super(message, {
            code: 'STORAGE_ERROR',
            context,
        });
        this.operation = options.operation;
        this.oid = options.oid;
        this.cause = options.cause;
    }
}
