There is a standard way to do exception handling in 3-Tier or N-Tier applications, which is applicable in any programming language (not specific to .Net or C# only), there are certain rules for Exception Handling. Refer to them below.
- Exception should be logged into the database.
- It should be logged on the origin location (from where it is caught).
- Once an exception is caught:
- It should be wrapped into a Custom Exception class and then thrown further up the calling layers.
- Exception details should be logged into the database only once.
- If the exception is thrown from some other layer, then it should be forwarded to a further layer without logging to the database (since it's already logged in the origin).
- If it's a UI layer then a user friendly message should be displayed to the user.
For more clarity refer to the following screen: