Log errors when the occur