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)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/906730
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8b9cd3d18df4894e0e8af0e16ed9f5dd88b70b3f
Gerrit-Change-Number: 906730
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]