adding email output on error or warn events