@Test public void shouldNotExcludeNestedException() { RaygunExcludeExceptionFilter f = new RaygunExcludeExceptionFilter(IllegalStateException.class); RaygunMessage message = new RaygunMessage(); message.getDetails().setError(new RaygunErrorMessage(new ClassNotFoundException("wrapper1", new ClassNotFoundException("wrapper2", new ClassNotFoundException("wrapper3"))))); assertNotNull(f.onBeforeSend(null, message)); }
public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if(message.getDetails() != null && message.getDetails().getError() != null) { RaygunErrorMessage error = message.getDetails().getError(); while(error != null && error.getThrowable() != null) { for (Class<?> excludeClass : excludeClasses) { if (excludeClass.isAssignableFrom(error.getThrowable().getClass())) { return null; } } error = error.getInnerError(); } } return message; }
RaygunExcludeExceptionFilter implements IRaygunOnBeforeSend, IRaygunSendEventFactory<IRaygunOnBeforeSend> { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if(message.getDetails() != null && message.getDetails().getError() != null) { RaygunErrorMessage error = message.getDetails().getError(); while(error != null && error.getThrowable() != null) { for (Class<?> excludeClass : excludeClasses) { if (excludeClass.isAssignableFrom(error.getThrowable().getClass())) { return null; } } error = error.getInnerError(); } } return message; } }
RaygunExcludeExceptionFilter implements IRaygunOnBeforeSend, IRaygunSendEventFactory<IRaygunOnBeforeSend> { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if(message.getDetails() != null && message.getDetails().getError() != null) { RaygunErrorMessage error = message.getDetails().getError(); while(error != null && error.getThrowable() != null) { for (Class<?> excludeClass : excludeClasses) { if (excludeClass.isAssignableFrom(error.getThrowable().getClass())) { return null; } } error = error.getInnerError(); } } return message; } RaygunExcludeExceptionFilter(Class<?>... excludeClasses); }
RaygunExcludeExceptionFilter implements IRaygunOnBeforeSend, IRaygunSendEventFactory<IRaygunOnBeforeSend> { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if(message.getDetails() != null && message.getDetails().getError() != null) { RaygunErrorMessage error = message.getDetails().getError(); while(error != null && error.getThrowable() != null) { for (Class<?> excludeClass : excludeClasses) { if (excludeClass.isAssignableFrom(error.getThrowable().getClass())) { return null; } } error = error.getInnerError(); } } return message; } RaygunExcludeExceptionFilter(Class<?>... excludeClasses); RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message); IRaygunOnBeforeSend create(); }
RaygunExcludeExceptionFilter implements IRaygunOnBeforeSend, IRaygunSendEventFactory<IRaygunOnBeforeSend> { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if(message.getDetails() != null && message.getDetails().getError() != null) { RaygunErrorMessage error = message.getDetails().getError(); while(error != null && error.getThrowable() != null) { for (Class<?> excludeClass : excludeClasses) { if (excludeClass.isAssignableFrom(error.getThrowable().getClass())) { return null; } } error = error.getInnerError(); } } return message; } RaygunExcludeExceptionFilter(Class<?>... excludeClasses); RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message); IRaygunOnBeforeSend create();  }