exception

  • Exception Handling Basics

    The other day, I was reviewing some code, and I saw a series of methods conforming to the following (anti) ‘pattern’ public class CustomerProcessor { public void ProcessCustomer(Customer customer) { try { if (customer.IsActive) ProcessActiveCustomer(customer); } catch (Exception ex) { throw ex; } } private void ProcessActiveCustomer(Customer customer) { try { CheckCustomerName(customer); WriteCustomerToFile(customer); } catch…