mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Added more error handling for ClientErrors while connecting with a wiki (due to Fandom issues)
This commit is contained in:
parent
23b5a5db1c
commit
3c840b1d42
3
setup.py
3
setup.py
|
@ -3,7 +3,6 @@ from setuptools import setup
|
|||
setup(
|
||||
name='RcGcDw',
|
||||
version='1.14.0.1',
|
||||
packages=[''],
|
||||
url='https://gitlab.com/piotrex43/RcGcDw/',
|
||||
license='GNU GPLv3',
|
||||
author='Frisk',
|
||||
|
@ -12,5 +11,5 @@ setup(
|
|||
keywords=['MediaWiki', 'recent changes', 'Discord', 'webhook'],
|
||||
package_dir={"": "src"},
|
||||
install_requires=["beautifulsoup4 >= 4.6.0", "requests >= 2.18.4", "schedule >= 0.5.0", "lxml >= 4.2.1"],
|
||||
python_requires="3.7"
|
||||
python_requires=">=3.7"
|
||||
)
|
||||
|
|
|
@ -124,7 +124,13 @@ class Wiki(object):
|
|||
request = self.api_request(self.construct_params(amount))
|
||||
except (ServerError, MediaWikiError):
|
||||
raise ConnectionError
|
||||
except (ClientError, KeyError, BadRequest):
|
||||
except ClientError as e:
|
||||
if settings.get("error_tolerance", 0) > 1:
|
||||
logger.error("When running RcGcDw received a client error that would indicate RcGcDw's mistake. However since your error_tolerance is set to a value higher than one we are going to log it and ignore it. If this issue persists, please check if the wiki still exists and you have latest RcGcDw version. Returned error: {}".format(e))
|
||||
raise ConnectionError
|
||||
else:
|
||||
raise
|
||||
except (KeyError, BadRequest):
|
||||
raise
|
||||
return request
|
||||
|
||||
|
|
Loading…
Reference in a new issue