/** * Fetch data, retrying in the event that that the service provider returns an error and we think * we can recover by restarting the protocol flow. */ private HttpResponseBuilder fetchWithRetry() throws OAuthRequestException { int attempts = 0; boolean retry; HttpResponseBuilder response = null; do { retry = false; ++attempts; try { response = attemptFetch(); } catch (OAuthProtocolException pe) { retry = handleProtocolException(pe, attempts); if (!retry) { if (pe.getProblemCode() != null) { throw new OAuthRequestException(pe.getProblemCode(), "Service provider rejected request", pe); } else { throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM, "Service provider rejected request", pe); } } } } while (retry); return response; }
/** * Fetch data, retrying in the event that that the service provider returns an error and we think * we can recover by restarting the protocol flow. */ private HttpResponseBuilder fetchWithRetry() throws OAuthRequestException { int attempts = 0; boolean retry; HttpResponseBuilder response = null; do { retry = false; ++attempts; try { response = attemptFetch(); } catch (OAuthProtocolException pe) { retry = handleProtocolException(pe, attempts); if (!retry) { if (pe.getProblemCode() != null) { throw new OAuthRequestException(pe.getProblemCode(), "Service provider rejected request", pe); } else { throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM, "Service provider rejected request", pe); } } } } while (retry); return response; }
/** * Fetch data, retrying in the event that that the service provider returns an error and we think * we can recover by restarting the protocol flow. */ private HttpResponseBuilder fetchWithRetry() throws OAuthRequestException { int attempts = 0; boolean retry; HttpResponseBuilder response = null; do { retry = false; ++attempts; try { response = attemptFetch(); } catch (OAuthProtocolException pe) { retry = handleProtocolException(pe, attempts); if (!retry) { if (pe.getProblemCode() != null) { throw new OAuthRequestException(pe.getProblemCode(), "Service provider rejected request", pe); } else { throw new OAuthRequestException(OAuthError.UNKNOWN_PROBLEM, "Service provider rejected request", pe); } } } } while (retry); return response; }