Exceptions

Assignments that teach Exceptions

Exceptions generally indicate that something unexpected has occurred in a program that must be handled in some way.  A number of types of Finch programs could benefit from built-in exception handling.  For example, if a Finch is programmed to seek a bright light, it may help to throw an exception if the Finch is not level with the ground, or if both of its obstacle sensors detect an obstruction.  More generally, any of the Finch's sensors can act as a trigger for an exception; whether it makes sense for the sensor reading to trigger an exception is simply a matter of how the assignment is written.