ToException

public static Exception ToException(this object o)
{
return new Exception(o.ToString());
}
Example:
Object o = new Object();
throw o.ToException();

Description

Turns any object to Exception. Very useful!

Details

Double click on the code to select all.

 

;