Handle things related to exceptions.
Create a dummy module which will raise an exception when attributes are accessed.
For soft dependencies we want to survive failing to import but we would like to raise an appropriate error when the functionality is actually requested so the user gets an easily debuggable message.
Return a function which will accept any arguments but raise the exception when called.
exc (Exception) – Will be raised later
failed – When called will raise exc
- Return type