Log exceptions

Related: #148