Added error logging to track cause of red build