code: protected void recordErrorMetrics(Throwable error) {
          requestMetric.setResponseCode(500);
          requestMetric.setError(true);
          requestMetric.setErrorMessage(error.getMessage());
      }
docs: Record an error (i.e. Exception)