17.8. Exercises

  1. What's the difference between debugging and tracing?

  2. Imagine you have some code that could potentially throw an exception. For example, you try to send an e-mail message to a mail server, or write a file to disk while you're not sure if you have the right permissions to do so. What kind of exception handling strategy would you use to avoid the exception from being displayed in the browser? What code would you need?

  3. You're taking over a web site that has been built by another developer who had never heard of exception handling. Your client is complaining about the quality of the site and the large number of "yellow screens of death" that users see. Besides analyzing the code for the entire application, what would be a quick solution to get information about the errors and the locations where they occur? And how can you shield the site's users from the dirty details of the exception messages?

Get Beginning ASP.NET 3.5: In C# and VB 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.