add logs when the exception thrws