programs are very fragile it would be ideal if code always returned valid resultbut sometimes valid result can' be calculated for exampleit' not possible to divide by zeroor to access the eighth item in five-item list in the old daysthe only way around this was to rigorously check the inputs for every function to make sure they made sense typicallyfunctions had special return values to indicate an error conditionfor examplethey could return negative number to indicate that positive value couldn' be calculated different numbers might mean different errors occurred any code that called this function would have to explicitly check for an error condition and act accordingly lot of code didn' bother to do thisand programs simply crashed howeverin the object-oriented worldthis is not the case in this we will study exceptionsspecial error objects that only need to be handled when it makes sense to handle them in particularwe will coverhow to cause an exception to occur how to recover when an exception has occurred how to handle different exception types in different ways cleaning up when an exception has occurred creating new types of exception using the exception syntax for flow control