Re-throw exceptions in C#
Forums:
void MethodWithException() {
try {
throw new Exception("test exception");
}
catch (Exception e) {
//implementation of any partial processing
//and send error to the calling code
throw;
}
}
try {
MethodWithException();
}
catch (Exception e) {
Console.WriteLine(e.Message);
}
- Log in to post comments