

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Errors and Exceptions in Python
incomplete
2: Try/Except Review
incomplete
3: Raising Your Own Exceptions
incomplete
4: Raising Exceptions Review
incomplete
5: Different Types of Exceptions
incomplete
6: Raising Exceptions Review
incomplete
7: Raising Exceptions Review
incomplete
8: Raising Exceptions Review
incomplete
9: Purchase Bug
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Software applications aren't perfect, and user input and network connectivity are far from predictable. Despite intensive debugging and unit testing, applications will still have failure cases.
Loss of network connectivity, missing database rows, out of memory issues, and unexpected user inputs can all prevent an application from performing "normally." It is your job to catch and handle any and all exceptions gracefully so that your app keeps working. When you are able to detect that something is amiss, you should be raising the errors yourself, in addition to the "default" exceptions that the Python interpreter will raise.
raise Exception("something bad happened")