jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609280 )
Change subject: [IMPR] Show additional hints with ValueErrors in _WbDataPage._validate
......................................................................
[IMPR] Show additional hints with ValueErrors in _WbDataPage._validate
Bug: T257013
Change-Id: Ic62af7f29d20f235201e1cbaecaf0ce5090dc612
---
M pywikibot/__init__.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 9dde2ad..1e08813 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -982,11 +982,13 @@
@type site: str
"""
if not isinstance(page, Page):
- raise ValueError('Page must be a pywikibot.Page object.')
+ raise ValueError(
+ 'Page {} must be a pywikibot.Page object not a {}.'
+ .format(page, type(page)))
# validate page exists
if not page.exists():
- raise ValueError('Page must exist.')
+ raise ValueError('Page {} must exist.'.format(page))
# validate page is on the right site, and that site supports the type
if not data_site:
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609280
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: Ic62af7f29d20f235201e1cbaecaf0ce5090dc612
Gerrit-Change-Number: 609280
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: ChongDae <cdpark(a)gmail.com>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <andre.costa(a)wikimedia.se>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged