"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const flow_node_handler_1 = require("./flow_node_handler");
const next_flow_node_info_1 = require("../next_flow_node_info");
class ErrorBoundaryEventHandler extends flow_node_handler_1.FlowNodeHandler {
    constructor(activityHandler) {
        super();
        this.activityHandler = activityHandler;
    }
    async executeIntern(flowNode, processToken, context) {
        try {
            const nextFlowNodeInfo = await this.activityHandler.execute(flowNode, processToken, context);
            return nextFlowNodeInfo;
        }
        catch (err) {
            const boundaryEvent = flowNode.getBoundaryEvents(context)[0];
            return new next_flow_node_info_1.NextFlowNodeInfo(await this.getNextFlowNodeFor(boundaryEvent.nodeDef, context), processToken);
        }
    }
}
exports.ErrorBoundaryEventHandler = ErrorBoundaryEventHandler;

//# sourceMappingURL=error_boundary_event_handler.js.map
