jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/444434 )

Change subject: [IMPR] Give an error message instead raising an exception
......................................................................

[IMPR] Give an error message instead raising an exception

Print a wellformed error message instead of raising an OSError exception

Change-Id: I568b81e9d6d9b25f74fdf93ce30d4fd9442a3423
---
M pwb.py
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Zhuyifei1999: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pwb.py b/pwb.py
index 33e265b..5270790 100755
--- a/pwb.py
+++ b/pwb.py
@@ -214,7 +214,9 @@
                     filename = testpath
                     break
             else:
-                raise OSError("%s not found!" % filename)
+                print('ERROR: {} not found! Misspelling?'.format(filename),
+                      file=sys.stderr)
+                return True

         # When both pwb.py and the filename to run are within the current
         # working directory:

--
To view, visit https://gerrit.wikimedia.org/r/444434
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I568b81e9d6d9b25f74fdf93ce30d4fd9442a3423
Gerrit-Change-Number: 444434
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1...@gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4...@gmail.com>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to