To illustrate this problem, let's introduce a spelling error into 'feedlist.dat'. Two of the most common typos in URLs are the dropping of a full stop (period) and the ommission of the third 'w' in 'www'. Take your pick and perform it on the first line of 'feedlist.dat'. The first line of my data file now looks like this:
Spiegel;http://ww.spiegel.de/schlagzeilen/rss/0,5291,676,00.xmlYou can see how easy it would be to make a mistake like this and how hard it would be to detect it by sight. Eventually, we shall add an editing feature into the application, but, for now, we must be wary of mistakes in our data file.
Now start your web browser and direct it to the index page of the RSS Reader. Select Der Spiegel's feed. What happened? It looks like absolutely nothing happened [If you are using the CGI version, you probably received an equally unhelpful "Internal Server Error"]. That is a problem that we are going to fix in this tutorial. One of the golden rules of Python, lines 10 and 11 of the "Zen of Python", reads:
Errors should never pass silently.We know that an error has occurred because we introduced it. Yet, it does not show in the RSS Reader. Why? Think about it, and then click to the next page to find the answer.
Unless explicitly silenced.
