log exception if thrown