ToException

public static class StringExtensions
    {
        public static void ToException (this string message)
        {
            throw new Exception(message);
        }
    }
Example:
"ExceptionText".ToException();

Description

Conveniently produces a exception from a given string.

Details

Double click on the code to select all.

 

;