private boolean checkConnectionForPrecisionException(HttpURLConnection connection)
    throws IOException, URISyntaxException {

    if (connection != null && connection.getResponseCode() == HttpStatus.SC_BAD_REQUEST) {
      InputStream errorStream = connection.getErrorStream();
      BufferedReader reader = new BufferedReader(new InputStreamReader(errorStream));
      String errorMessage = reader.readLine();
      if (errorMessage != null && errorMessage.contains("PrecisionLimitExceededException")) {
        LOG.debug("Encountered Precision exception while requesting metrics : {}", errorMessage);
        return false;
      } else {
        throw new IOException(errorMessage);
      }
    }
    return true;
  }
Helper class to call AMS backend that is utilized by @AMSPropertyProvider
and @AMSReportPropertyProvider as well as @TimelineMetricCacheEntryFactory
ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/MetricsRequestHelper.java