Enhance toThrow to take the Exception class as another alternative parameter

Enhance toThrow to take the Exception class as another alternative parameter.

Also enhanced documentation to reflect different types of arguments that are accepted.