"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocalStateError = void 0;
const utils_js_1 = require("./utils.cjs");
/**
 * Represents an error when executing `@client` fields from `LocalState`.
 */
class LocalStateError extends Error {
    /** Determine if an error is a `LocalStateError` instance */
    static is(error) {
        return (0, utils_js_1.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;
        (0, utils_js_1.brand)(this);
        Object.setPrototypeOf(this, LocalStateError.prototype);
    }
}
exports.LocalStateError = LocalStateError;
//# sourceMappingURL=LocalStateError.cjs.map
