use of com.newrelic.agent.introspec.ErrorEvent in project newrelic-java-agent by newrelic.
the class GrpcErrorsTest method testUncaughtException.
@Test
public void testUncaughtException() {
try {
client.throwException("Blocking");
} catch (Exception e) {
}
String fullMethod = "helloworld.Greeter/ThrowException";
String clientTxName = "OtherTransaction/Custom/app.TestClient/throwException";
String serverTxName = "WebTransaction/gRPC/helloworld.Greeter/ThrowException";
ValidationHelper.validateExceptionGrpcInteraction(server, clientTxName, serverTxName, fullMethod, "UNARY", "Blocking", 2);
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Collection<ErrorEvent> errorEvents = introspector.getErrorEvents();
CatHelper.verifyOneSuccessfulCat(introspector, clientTxName, serverTxName);
// Even though gRPC errors are disabled this will still generate an error event
// because the uncaught exception triggers the agent's built-in error capture
assertEquals(1, errorEvents.size());
}
Aggregations