Improved mock generation exception.