-
-
Notifications
You must be signed in to change notification settings - Fork 17
Problem getting list of "wanted" items when there are none #92
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
Comments
I can just catch the System.InvalidOperationException and return, but I mean something more natural. |
I think this error occurs because WikiClientLibrary/WikiClientLibrary/Pages/PageFactory.cs Lines 18 to 38 in 243ae2c
I'm not sure how it happens, but perhaps can you share me the code you've used to return the |
Sorry for the late reply. Unfortunately, the exact code that was giving this exact error is gone. However, I later worked around a seemingly similar error in the same way as I previously worked around the earlier error, and I can show you the new one: Differences between then and nowDifference in behaviorThe difference in behavior is that whereas in the previous case, an exception was being thrown, in this case, it behaves as if the Difference in codeI don't know exactly what the difference in my code is that led to this change in behavior, but I suspect that it's this: Previously (when the problem was that an exception was being thrown), I was doing something like...
... then doing an
... and then doing an WorkaroundI worked around both this error and the previous one by creating the following two classes: Class KludgyWikiPageEnumerable
Class KludgyWikiPageEnumerator
UsageUsage is just wrapping the
|
Actually, Released |
I'm trying to get Wantedtemplates, Wantedpages, etc. It's working fine for me for some of them, but an exception is being thrown by others (from within WikiClientLibrary). I believe I have narrowed it down to "works fine" = "there are some such wanted things" and "exception thrown" = "there are no such wanted things".
I'm not sure if this is because I'm doing something wrong or if it's perhaps a bug in WCL or in something at a deeper level than that. If it's not simply because I'm doing something wrong, I suspect it might have something to do with the issue outlined here: Apparently "HasValues" should be called on a Newtonsoft object before trying to access a child object. Disclaimer: I know nothing about Newtonsoft beyond what it is and that it's popular.
Am I doing something wrong? If not, is there a workaround for this? Any help would be appreciated.
I am getting the error when I try to do an "await foreach" on the items, and also if I simply try to get the count of them.
Here's the part of my code that's failing:
And here's the exception (in the "CountAsync" case):
The text was updated successfully, but these errors were encountered: