Exception handling

Exception handling is something that you as a developer need to be aware of, and you must also be very good at discerning what information to display to the end user and what information to log. Believe it or not, writing good error messages is harder than it looks. Too much information displayed to the user might instill a sense of distrust in the software. Too little information logged for debugging purposes is also not useful at all to the poor soul that needs to fix the error. This is why you need to have an exception handling strategy. A nice rule of thumb is to display a message to the user stating that something went wrong, but that a notification has been sent to support personnel. Think of Google, Dropbox, Twitter ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.