Method throwing an exception in C#

//any method can throw an error
void MethodWithException() {
    throw new Exception("test exception");
}