import { BaseApiConverterNode } from "../BaseApiConverter.node";
export class BaseOpenrpcConverterNode extends BaseApiConverterNode {
    context;
    accessPath;
    pathId;
    constructor({ input, context, accessPath, pathId, }) {
        super(input, context);
        this.context = context;
        this.accessPath = [...accessPath];
        this.pathId = pathId;
        if (this.pathId &&
            this.pathId !== this.accessPath[this.accessPath.length - 1]) {
            this.accessPath.push(this.pathId);
            context.logger.debug(`Processing #/${this.accessPath.join("/")}`);
        }
    }
    safeParse(...additionalArgs) {
        try {
            this.parse(...additionalArgs);
        }
        catch {
            this.context.errors.error({
                message: "Error converting node. Please contact support if the error persists",
                path: this.accessPath,
            });
        }
    }
}
