throw new AssertionError("Bot privileges missing or revoked, or session expired.");
if ((assertion & ASSERT_USER) == ASSERT_USER && line.contains("error code=\"assertuserfailed\""))
// assert !line.contains("error code=\"assertuserfailed\"") : "Session expired.";
throw new AssertionError("Session expired.");
if (line.contains("error code=\"permissiondenied\""))
throw new CredentialNotFoundException("Permission denied."); // session expired or stupidity
// rate limit (automatic retry), though might be a long one (e.g. email)
if (line.contains("error code=\"ratelimited\""))
{
log(Level.WARNING, caller, "Server-side throttle hit.");
throw new HttpRetryException("Action throttled.", 503);