@Test public void shouldDefaultToHasStoredExceptionsSoThatSendsOnFirstError() throws InterruptedException { assertTrue(handler.hasStoredExceptions); handler.onBeforeSend(client, null); }
public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if (enabled && hasStoredExceptions && sendingStoredExceptions == null) { synchronized (this) { if (sendingStoredExceptions == null) { sendingStoredExceptions = new RaygunSendStoredExceptions(client, this.getStorage(this.storageDir)); new Thread(new Runnable() { public void run() { sendingStoredExceptions.run(); sendingStoredExceptions = null; hasStoredExceptions = false; } }).start(); } } } return message; }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if (enabled && hasStoredExceptions && sendingStoredExceptions == null) { synchronized (this) { if (sendingStoredExceptions == null) { sendingStoredExceptions = new RaygunSendStoredExceptions(client, this.getStorage(this.storageDir)); new Thread(new Runnable() { public void run() { sendingStoredExceptions.run(); sendingStoredExceptions = null; hasStoredExceptions = false; } }).start(); } } } return message; } }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if (enabled && hasStoredExceptions && sendingStoredExceptions == null) { synchronized (this) { if (sendingStoredExceptions == null) { sendingStoredExceptions = new RaygunSendStoredExceptions(client, this.getStorage(this.storageDir)); new Thread(new Runnable() { public void run() { sendingStoredExceptions.run(); sendingStoredExceptions = null; hasStoredExceptions = false; } }).start(); } } } return message; } RaygunOnFailedSendOfflineStorageHandler(String storageDir, String apiKey); }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if (enabled && hasStoredExceptions && sendingStoredExceptions == null) { synchronized (this) { if (sendingStoredExceptions == null) { sendingStoredExceptions = new RaygunSendStoredExceptions(client, this.getStorage(this.storageDir)); new Thread(new Runnable() { public void run() { sendingStoredExceptions.run(); sendingStoredExceptions = null; hasStoredExceptions = false; } }).start(); } } } return message; } RaygunOnFailedSendOfflineStorageHandler(String storageDir, String apiKey); void setEnabled(boolean enabled); RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message); String onFailedSend(RaygunClient client, String jsonPayload); IRaygunOnBeforeSend create(); }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { if (enabled && hasStoredExceptions && sendingStoredExceptions == null) { synchronized (this) { if (sendingStoredExceptions == null) { sendingStoredExceptions = new RaygunSendStoredExceptions(client, this.getStorage(this.storageDir)); new Thread(new Runnable() { public void run() { sendingStoredExceptions.run(); sendingStoredExceptions = null; hasStoredExceptions = false; } }).start(); } } } return message; } RaygunOnFailedSendOfflineStorageHandler(String storageDir, String apiKey); void setEnabled(boolean enabled); RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message); String onFailedSend(RaygunClient client, String jsonPayload); IRaygunOnBeforeSend create();  }