I have a piece of try catch code:
try { ... } catch(Exception ex) { ModelState.AddModelError( \"duplicateInvoiceNumberOrganisation\", \"The com
To get name of the exception you can use
catch (Exception exc){ if (exc.GetType().FullName == "Your_Exception") { // The same can be user for InnerExceptions // exc.InnerException.GetType().FullName } }