Attempting to fetch a login token will raise an APIError on older MediaWiki versions (tested on v1.20.2), so we need to catch it.