You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Exception in thread "main" com.squareup.moshi.JsonDataException: Expected one of [public, private, restricted, gold_restricted, archived] but was user at path $.data.children[7].data.subreddit_type
Happens "most of the times" in the following code:
val comments = reddit.subreddit("all").comments().limit(50).build().iterator()
for (i in0..9) {
TimeUnit.SECONDS.sleep(1)
println(comments.next()[1].author)
}
The text was updated successfully, but these errors were encountered:
This only happens when comenting on a user subreddit (see here for an example). Should be an easy fix. All we'd have to do is add an enum value for the user type and handle future unknown values.
I'll fix this when I get home.
Also you don't have to manually sleep your thread, the library handles rate limiting for you.
Error:
Exception in thread "main" com.squareup.moshi.JsonDataException: Expected one of [public, private, restricted, gold_restricted, archived] but was user at path $.data.children[7].data.subreddit_type
Happens "most of the times" in the following code:
The text was updated successfully, but these errors were encountered: