jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified Matěj Suchánek: Looks good to me, approved
[fix] retry api request on ServerError

Again retry api request on ServerError but without FatalServerError.
ServerError is raised when a requests.ReadTimeout
or requests.ConnectTimeout occurs.

This partially reverts commit 1df22074e5b7484295cedbcd897beb70bf50521a.

Bug: T364275
Bug: T364393
Change-Id: I988cf7c824fd634e1c15092ef9471d58b5434074
---
M pywikibot/data/api/_requests.py
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index 2cc5cb7..b6afb6b 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -30,10 +30,10 @@
from pywikibot.exceptions import (
Client414Error,
Error,
+ FatalServerError,
MaxlagTimeoutError,
NoUsernameError,
Server504Error,
- ServerError,
SiteDefinitionError,
)
from pywikibot.login import LoginStatus
@@ -694,7 +694,7 @@
pywikibot.warning(
'Caught HTTP 414 error, although not using GET.')
raise
- except (ConnectionError, ServerError):
+ except (ConnectionError, FatalServerError):
# This error is not going to be fixed by just waiting
pywikibot.error(traceback.format_exc())
raise

To view, visit change 1029487. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I988cf7c824fd634e1c15092ef9471d58b5434074
Gerrit-Change-Number: 1029487
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: Masti <mastigm@gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: JAn Dudík <jan.dudik@gmail.com>
Gerrit-MessageType: merged