Add exception handlers for the functions in external modules