print message when exception is raised