Add feature to configure mock to raise a exception.