export class EngineError extends Error {
    code;
    constructor(code, message, options) {
        super(message, options);
        this.name = "EngineError";
        this.code = code;
    }
}
export function hasEngineErrorCode(error, code) {
    const seen = new Set();
    let current = error;
    while (current instanceof Error && !seen.has(current)) {
        seen.add(current);
        if (current.code === code)
            return true;
        current = current.cause;
    }
    return false;
}
//# sourceMappingURL=errors.js.map