Error handling on gonewild rips

This commit is contained in:
4pr0n 2014-03-08 02:38:39 -08:00
parent c48ebff21d
commit 7c63f3a492

View File

@ -64,6 +64,10 @@ public class GonewildRipper extends AbstractRipper {
.execute() .execute()
.body(); .body();
json = new JSONObject(jsonString); json = new JSONObject(jsonString);
if (json.has("error")) {
logger.error("Error while retrieving user posts:" + json.getString("error"));
break;
}
posts = json.getJSONArray("posts"); posts = json.getJSONArray("posts");
if (posts.length() == 0) { if (posts.length() == 0) {
break; // No more posts to get break; // No more posts to get