Hi,

> def get_html(...):
>     try:
>         ... actually go get the info
>         return info
>     except (ConnectionError, OSError, SocketError) as e:
>         raise ContentNotFoundError from e

Personally, I never liked "early returns". I would rather used a variable and 
the last line in the function would be return variable.
Anyway, I got the point.

> To use this code, what you'd do is:
> 
> try:
>     data = get_html(...)
> except ContentNotFoundError:
>     # deal with the case of not having anything to work with

I got a picture. Thanks.

I have to rethink now about two approaches. One would be as you have suggested 
in this mail - raising ContentNotFoundError, and another one would be not to 
mask root exceptions and deal with them instead of ContentNotFoundError.

You have clarified to me the concept. Thanks.

Regards. 
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to