Exception handling for modules