Skip to content

Commit

Permalink
booru/page: Check success attribute on danbooru
Browse files Browse the repository at this point in the history
This is only present when loading posts fails, and is set to false.
  • Loading branch information
ahodesuka committed Oct 10, 2018
1 parent d080140 commit a93af1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/booru/page.cc
Expand Up @@ -328,8 +328,9 @@ void Page::get_posts()

// XXX: Ocassionally Danbooru returns a 500 internal server error
// "uninitialized constant LegacyController::Builder"
// and sets success to false
if (m_Posts && m_Site->get_type() == Site::Type::DANBOORU)
success = m_Posts->get_value() != "uninitialized constant LegacyController::Builder";
success = m_Posts->get_attribute("success") != "false";
}
}
while (!m_Curler.is_cancelled() && !success && ++retryCount < RETRY_COUNT);
Expand Down

0 comments on commit a93af1d

Please sign in to comment.