Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error return values in WikiPage::getSection and setText #116

Closed
Xymph opened this issue Jul 11, 2021 · 0 comments
Closed

Fix error return values in WikiPage::getSection and setText #116

Xymph opened this issue Jul 11, 2021 · 0 comments
Labels

Comments

@Xymph
Copy link
Collaborator

Xymph commented Jul 11, 2021

Commit aeaa486 introduced checks in getSection() for undefined sections that return false if not found. This is inconsistent with other methods (e.g. getText(), Wikimate::download() and many Wikifile methods) which return null to indicate error (and otherwise a string or array). Only boolean methods should return false upon error, I think.

Also, recent commit 0a00740 returns a null upon error in boolean method setText(), which should be false.

The getSection change is somewhat API breaking -- the difference is only noticeable when testing with '===' and '!==' but I did that in some of my client scripts -- so it should go in just before we bump to v1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant