diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/PagerDutyController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/PagerDutyController.groovy index 681899b264..fb528e39f9 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/PagerDutyController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/PagerDutyController.groovy @@ -25,8 +25,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.scheduling.annotation.Scheduled import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestMethod import org.springframework.web.bind.annotation.RestController +import retrofit.RetrofitError + import java.util.concurrent.atomic.AtomicReference @CompileStatic @@ -79,7 +80,11 @@ class PagerDutyController { log.info("Fetched {} PagerDuty services", services?.size()) pagerDutyServicesCache.set(services) } catch (e) { - log.error("Unable to refresh PagerDuty service list", e) + if (e instanceof RetrofitError && e.response?.status == 429) { + log.warn("Unable to refresh PagerDuty service list (throttled!)") + } else { + log.error("Unable to refresh PagerDuty service list", e) + } } try { @@ -87,7 +92,11 @@ class PagerDutyController { log.info("Fetched {} PagerDuty onCall", onCalls?.size()) pagerDutyOnCallCache.set(onCalls) } catch (e) { - log.error("Unable to refresh PagerDuty onCall list", e) + if (e instanceof RetrofitError && e.response?.status == 429) { + log.warn("Unable to refresh PagerDuty onCall list (throttled!)") + } else { + log.error("Unable to refresh PagerDuty onCall list", e) + } } }