renamed method logError to collectErrorForUI