e.getHttpResponseCode(), e.getHttpResponseMessage());
// The update failed. We don't know if this is permanent or temporary but
// let's assume that it is permanent if it's our fault (4xx)
if (e.getHttpResponseCode()>=400&&e.getHttpResponseCode()<500)
throw new UpdateFailedException("Unexpected response code: " + e.getHttpResponseCode(), new Exception(), true,
ApiKey.PermanentFailReason.clientError(e.getHttpResponseCode(), e.getHttpResponseMessage()));
throw new UpdateFailedException(e);
} catch (RateLimitReachedException e) {
// Couldn't fetch storyline, rate limit reached
countFailedApiCall(updateInfo.apiKey, updateInfo.objectTypes, then, fetchUrl, Utils.stackTrace(e),
429, "Rate limit reached");
// Rethrow the rate limit reached exception
throw e;
} catch (IOException e) {
countFailedApiCall(updateInfo.apiKey, updateInfo.objectTypes, then, fetchUrl, Utils.stackTrace(e), -1, "I/O");
// The update failed. We don't know if this is permanent or temporary.
// Throw the appropriate exception.
throw new UpdateFailedException(e);
}
return fetched;
}