jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/906730 )
Change subject: [IMPR] Add parameters to APIError to show them ......................................................................
[IMPR] Add parameters to APIError to show them
Bug: T333957 Change-Id: I8b9cd3d18df4894e0e8af0e16ed9f5dd88b70b3f --- M pywikibot/data/api/_requests.py 1 file changed, 13 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py index 3c7bbc6..0377577 100644 --- a/pywikibot/data/api/_requests.py +++ b/pywikibot/data/api/_requests.py @@ -1083,7 +1083,9 @@ f'API Error: query=\n{pprint.pformat(param_repr)}') pywikibot.log(f' response=\n{result}')
- raise pywikibot.exceptions.APIError(**error) + args = {'param': body} if body else {} + args.update(error) + raise pywikibot.exceptions.APIError(**args) except TypeError: raise RuntimeError(result)
pywikibot-commits@lists.wikimedia.org