import { brand, isBranded } from "./utils.js";
/**
 * Represents an error when executing `@client` fields from `LocalState`.
 */
export class LocalStateError extends Error {
    /** Determine if an error is a `LocalStateError` instance */
    static is(error) {
        return isBranded(error, "LocalStateError");
    }
    /**
     * The path to the field that caused the error, if the error is caused by a
     * field.
     */
    path;
    constructor(message, options = {}) {
        super(message, { cause: options.sourceError });
        this.name = "LocalStateError";
        this.path = options.path;
        brand(this);
        Object.setPrototypeOf(this, LocalStateError.prototype);
    }
}
//# sourceMappingURL=LocalStateError.js.map
