[python][genrator] Fixed try_get: handling URLError.
This commit is contained in:
parent
13121e88ee
commit
fc0a4a88ee
1 changed files with 2 additions and 0 deletions
|
@ -55,6 +55,8 @@ def try_get(obj, prop, *args, **kwargs):
|
|||
raise GettingError(f"Page not found {e.msg}")
|
||||
except KeyError:
|
||||
raise GettingError(f"Getting {prop} field failed. {prop} not found.")
|
||||
except urllib.error.URLError:
|
||||
raise GettingError(f"URLError: {obj}, {prop}, {args}, {kwargs}")
|
||||
|
||||
raise GettingError(f"Getting {prop} field failed. "
|
||||
f"All {REQUEST_ATTEMPTS} attempts are spent")
|
||||
|
|
Reference in a new issue