### Question:
HttpErrorStatusMetrics implements HttpErrorStatusListener { @Override public void proxyErrorOccurred(HttpResponseStatus status, Throwable cause) { record(status); if (isError(status)) { incrementExceptionCounter(cause, status); } } HttpErrorStatusMetrics(MetricRegistry metricRegistry); @Override void proxyErrorOccurred(HttpResponseStatus status, Throwable cause); @Override void proxyErrorOccurred(Throwable cause); @Override void proxyErrorOccurred(LiveHttpRequest request, InetSocketAddress clientAddress, HttpResponseStatus status, Throwable cause); @Override void proxyWriteFailure(LiveHttpRequest request, LiveHttpResponse response, Throwable cause); @Override void proxyingFailure(LiveHttpRequest request, LiveHttpResponse response, Throwable cause);  }### Answer:
@Test public void pluginExceptionsAreNotRecordedAsStyxUnexpectedErrors() { errorListener.proxyErrorOccurred(INTERNAL_SERVER_ERROR, new PluginException("bad")); assertThat(count("styx.response.status.500"), is(1)); assertThat(statusCountsExcluding("styx.response.status.500"), everyItem(is(0))); assertThat(meterCount("styx.errors"), is(0)); }
@Test public void nonErrorStatusesIsNotRecordedForProxyEvenIfExceptionIsSupplied() { MetricRegistry registry = mock(MetricRegistry.class); HttpErrorStatusMetrics reporter = new HttpErrorStatusMetrics(registry); reset(registry); reporter.proxyErrorOccurred(OK, new RuntimeException("This shouldn't happen")); verifyZeroInteractions(registry); }