add error logging for cli