added logger + manage error at generation time