Implementing callback functionality for exception routines