Catch exceptions thrown by modules.