Added Exception and log when config generation goes wrong.