O'Reilly logo

Head First C#, 3rd Edition by Andrew Stellman, Jennifer Greene

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Exception Handling: Putting out fires gets old

image with no caption

Programmers aren’t meant to be firefighters.

You’ve worked your tail off, waded through technical manuals and a few engaging Head First books, and you’ve reached the pinnacle of your profession. But you’re still getting panicked phone calls in the middle of the night from work because your program crashes, or doesn’t behave like it’s supposed to. Nothing pulls you out of the programming groove like having to fix a strange bug...but with exception handling, you can write code to deal with problems that come up. Better yet, you can even react to those problems, and keep things running.

Brian needs his excuses to be mobile

Brian recently got reassigned to the international division. Now he flies all over the world. But he still needs to keep track of his excuses, so he installed the Excuse Manager app on his laptop and takes it with him everywhere.

image with no caption

But the program isn’t working!

Brian chose a brand new, empty folder and clicked the Random Excuse button, and got a pretty nasty-looking error. What gives?

image with no caption

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required