@Override public void eventOccurred(ResponseReceivedEvent eventArg) { RequestResult currentResult = operationContext.getLastResult(); int statusCode = currentResult.getStatusCode(); // Check if it's a client-side error: a 4xx status // We exclude 404 because it happens frequently during the normal // course of operation (each call to exists() would generate that // if it's not found). if (statusCode >= HTTP_BAD_REQUEST && statusCode < HTTP_INTERNAL_ERROR && statusCode != HTTP_NOT_FOUND) { instrumentation.clientErrorEncountered(); } else if (statusCode >= HTTP_INTERNAL_ERROR) { // It's a server error: a 5xx status. Could be an Azure Storage // bug or (more likely) throttling. instrumentation.serverErrorEncountered(); } } }
@Override public void eventOccurred(ResponseReceivedEvent eventArg) { RequestResult currentResult = operationContext.getLastResult(); int statusCode = currentResult.getStatusCode(); // Check if it's a client-side error: a 4xx status // We exclude 404 because it happens frequently during the normal // course of operation (each call to exists() would generate that // if it's not found). if (statusCode >= HTTP_BAD_REQUEST && statusCode < HTTP_INTERNAL_ERROR && statusCode != HTTP_NOT_FOUND) { instrumentation.clientErrorEncountered(); } else if (statusCode >= HTTP_INTERNAL_ERROR) { // It's a server error: a 5xx status. Could be an Azure Storage // bug or (more likely) throttling. instrumentation.serverErrorEncountered(); } } }