jenkins-bot submitted this change.
[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(-)
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 change 906730. To unsubscribe, or for help writing mail filters, visit settings.