|
25 | 25 | import json |
26 | 26 | from bs4 import BeautifulSoup |
27 | 27 | from requests.exceptions import ConnectionError |
| 28 | +from .flaresolverr.flaresolverr import FlaresolverrException |
28 | 29 | from .ItchGame import ItchGame |
29 | 30 | from .ItchSale import ItchSale |
30 | 31 | from .CfWrapper import CfWrapper |
@@ -76,8 +77,13 @@ def get_all_sales( |
76 | 77 | games_num += games_added |
77 | 78 | except (ConnectionError) as ex: |
78 | 79 | print(f'A connection error has occurred while parsing sale page {page}. Reason: {ex}') |
79 | | - print('Aborting current sale refresh.') |
80 | 80 | if not no_fail: |
| 81 | + print('Aborting current sale refresh.') |
| 82 | + exit(1) |
| 83 | + except (FlaresolverrException) as ex: |
| 84 | + print(f'A FlareSolverr error has occurred while parsing sale page {page}. Reason: {ex}') |
| 85 | + if not no_fail: |
| 86 | + print('Aborting current sale refresh.') |
81 | 87 | exit(1) |
82 | 88 | #pylint: disable=broad-exception-caught |
83 | 89 | except Exception as ex: |
@@ -179,8 +185,13 @@ def get_all_sale_pages(category: str = 'games', no_fail: bool =False) -> List[It |
179 | 185 | games_num += games_added |
180 | 186 | except ConnectionError as ex: |
181 | 187 | print(f'A connection error has occurred while parsing {category} sale page {page}. Reason: {ex}') |
182 | | - print('Aborting current sale refresh.') |
183 | 188 | if not no_fail: |
| 189 | + print('Aborting current sale refresh.') |
| 190 | + exit(1) |
| 191 | + except FlaresolverrException as ex: |
| 192 | + print(f'A FlareSolverr error has occurred while parsing {category} sale page {page}. Reason: {ex}') |
| 193 | + if not no_fail: |
| 194 | + print('Aborting current sale refresh.') |
184 | 195 | exit(1) |
185 | 196 | #pylint: disable=broad-exception-caught |
186 | 197 | except Exception as ex: |
|
0 commit comments