function errorsOccurred = construct_chart_ir_for_rtw(chart, hChart)
    errorsOccurred = false;
    display_chart_codegen_message(chart,'rtw');
    try
        compute_chart_information(chart);
        construct_module(chart, hChart);
    catch ME
        errorsOccurred = true;
        if ~isempty(ME.identifier) 
            rethrow(ME);
        end
    end
