function hasErr = profileSave(profile, fullPath, postSaveFcn)
    try
        profile.saveToFile(fullPath);
        hasErr = false;
    catch me
        dp = DAStudio.DialogProvider;
        eDlg = dp.errordlg(...
            DAStudio.message('SystemArchitecture:ProfileDesigner:ErrorSavingProfileMsg', me.message), ...
            DAStudio.message('SystemArchitecture:ProfileDesigner:ErrorSavingProfile'), ...
            true); % non-blocking
        hasErr = true;
    end

    
    if isa(postSaveFcn, 'function_handle')
        postSaveFcn();
    end

    
end