public void errorFromOrigin(final Throwable ex) {
        try {
            // Flag that there was an origin server related error for the loadbalancer to choose
            // whether to circuit-trip this server.
            if (originConn != null) {
                // NOTE: if originConn is null, then these stats will have been incremented within
                // PerServerConnectionPool
                // so don't need to be here.
                originConn.getServer().incrementSuccessiveConnectionFailureCount();
                originConn.getServer().addToFailureCount();

                originConn.flagShouldClose();
            }

            // detach from current origin
            final Channel originCh = unlinkFromOrigin();

            methodBinding.bind(() -> processErrorFromOrigin(ex, originCh));
        } catch (Exception e) {
            channelCtx.fireExceptionCaught(ex);
        }
    }
@Test
    public void onErrorFromOriginNoRetryAdjustment() {
        doReturn(OutboundErrorType.RESET_CONNECTION).when(attemptFactory).mapNettyToOutboundErrorType(any());
        proxyEndpoint.errorFromOrigin(new RuntimeException());

        verify(nettyOrigin).adjustRetryPolicyIfNeeded(request);
        verify(nettyOrigin).connectToOrigin(any(), any(), anyInt(), any(), any(), any());
    }