Skip to content

Commit

Permalink
Rebasing
Browse files Browse the repository at this point in the history
Enhance API limit reached handling

Signed-off-by: clinique <[email protected]>
Signed-off-by: [email protected] <[email protected]>
  • Loading branch information
clinique committed Mar 15, 2024
1 parent 7de86ba commit 07c499b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ public synchronized <T> T executeUri(URI uri, HttpMethod method, Class<T> clazz,
"@text/maximum-usage-reached [ \"%d\" ]".formatted(API_LIMIT_INTERVAL_S), null, null);
}
throw e;
// } catch (InterruptedException e) {
// Thread.currentThread().interrupt();
// updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
// throw new NetatmoException("Request interrupted");
} catch (InterruptedException | TimeoutException | ExecutionException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
throw new NetatmoException("Request interrupted");
} catch (TimeoutException | ExecutionException e) {
if (retryCount > 0) {
logger.debug("Request error, retry counter: {}", retryCount);
return executeUri(uri, method, clazz, payload, contentType, retryCount - 1);
Expand Down

0 comments on commit 07c499b

Please sign in to comment.