catch errors on irm for unittest