Show code gen errors to the user in a modal

Make a general modal constoller for general use case