added error handling to karma run in build