> The best way is probably to do nothing at all, and let the caller handle > any exceptions.
In that case every call of the get_html function has to be in the try/except block with many exceptions. Sometimes, it is enough just to know whether I managed to get the html or not. In that case, I could for example, in get_html have try/except block which will as result raise let's say NoHtml custom exception or return some special value. Raising an exception forces me to put every call of the get_html function in try/except block. If I am returning a special value, than I can call get_html and then test the value. I am not sure which approach is better. -- https://mail.python.org/mailman/listinfo/python-list