#100DaysOfCode in Python Transcripts
Chapter: Days 25-27: Error handling
Lecture: Your turn: Day 2
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Day 2, your goal is to discover all the error conditions that you might need to catch, and actually determine the exception type that
0:09
that results in, in Python. Are you working with something that talks to a database? What kind of errors could you get from the database?
0:16
Are you talking to something that goes across the network? What type of errors come across, from say, the network being down or DNS not working,
0:23
or the network being on, but not being able to reach the host, all those sorts of things. So come up with that list, and figure out what type,
0:32
what actual exception type in Python does it surface as. All right, if it's a connection error it could be something built into the standard library,
0:39
or it could be something in say, requests, as we saw in our example. So, you're going to have know exactly what those types are
0:45
so that you can actually write the probably error handling code. That's it for today, it might be a little bit tricky to get your app
0:52
into all the different situations that it's going to encounter, all right? Some of these errors are hard to trigger,
0:57
but do your best to figure out all the various error cases you're going to run into.