Add support for the onException callback