catch exceptions when creating the module