3 ms·
The finally clause does not have access to the exception details, as it executes regardless of whether there is an exception or not. You can't do "Log(ex);" in
by SideburnsOfDoom 12y ago
The finally clause does not have access to the exception details, as it executes regardless of whether there is an exception or not. You can't do "Log(ex);" in the finally block. And you would want to put the exception into the log.
You also need a boolean and a few extra lines of control code as your example shows.