adding logging for raised errors