/** * Get an error response for a request with specified throttle time in the response if applicable */ public abstract AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e);
/** * Get the error counts corresponding to an error response. This is overridden for requests * where response may be null (e.g produce with acks=0). */ public Map<Errors, Integer> errorCounts(Throwable e) { AbstractResponse response = getErrorResponse(0, e); if (response == null) throw new IllegalStateException("Error counts could not be obtained for request " + this); else return response.errorCounts(); }
private void checkErrorResponse(AbstractRequest req, Throwable e) throws Exception { checkResponse(req.getErrorResponse(e), req.version()); }
if (apiKey != ApiKeys.SASL_AUTHENTICATE) { IllegalSaslStateException e = new IllegalSaslStateException("Unexpected Kafka request of type " + apiKey + " during SASL authentication."); buildResponseOnAuthenticateFailure(requestContext, requestAndSize.request.getErrorResponse(e)); throw e;