I am using the following code:
catch (Exception ex) {
processException(ex);
return View("CreateEdit", vm);
}
Is it necessary to declare the exception “Exception ex”. I am wondering does a catch block
ever have anything in the parenthesis that follows that is not related to the something
derived from Exception?
In the catch block you will have to give the type of exception you want to catch. All those types have to be derived from the class
System.ExceptionIt is best not to catch exceptions of type
Exceptiondirectly and rather catch specific exceptions. A catch block that handles System.Exception(if present) is best specified last.http://msdn.microsoft.com/en-us/library/ms229007.aspx
http://msdn.microsoft.com/en-us/library/system.exception.aspx