2 ms·
Erh, exception types should include an inner exception parameter, for the generic one they wrap. So neither of your two examples are all that great.
by moron4hire 8y ago
Erh, exception types should include an inner exception parameter, for the generic one they wrap. So neither of your two examples are all that great.
- scarface74 8y agoWhy would I wrap an exception if I don’t plan to have special handling? If it is exception that I didn’t throw because of a business reason, why not just throw the original exception?
- moron4hire 8y agoIf you don't have any special handling, then why are you catching it at all?
- scarface74 8y agoThat was the "//Do stuff" part, you may want to do some cleanup (in C# usually handled by a finally block or a "using" block), send a custom notification, logging (usually I would just let the client handle logging), etc.