Commit 54632d59 authored by Tiago Cunha's avatar Tiago Cunha

Adding extra on error handler

parent dd29cdd7
...@@ -99,23 +99,27 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -99,23 +99,27 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
.filter(event -> event instanceof DDPSubscription.DocEvent) .filter(event -> event instanceof DDPSubscription.DocEvent)
.cast(DDPSubscription.DocEvent.class) .cast(DDPSubscription.DocEvent.class)
.filter(event -> isTarget(event.collection)) .filter(event -> isTarget(event.collection))
.subscribe(docEvent -> { .subscribe(
try { docEvent -> {
if (docEvent instanceof DDPSubscription.Added.Before) { try {
onDocumentAdded((DDPSubscription.Added) docEvent); //ignore Before if (docEvent instanceof DDPSubscription.Added.Before) {
} else if (docEvent instanceof DDPSubscription.Added) { onDocumentAdded((DDPSubscription.Added) docEvent); //ignore Before
onDocumentAdded((DDPSubscription.Added) docEvent); } else if (docEvent instanceof DDPSubscription.Added) {
} else if (docEvent instanceof DDPSubscription.Removed) { onDocumentAdded((DDPSubscription.Added) docEvent);
onDocumentRemoved((DDPSubscription.Removed) docEvent); } else if (docEvent instanceof DDPSubscription.Removed) {
} else if (docEvent instanceof DDPSubscription.Changed) { onDocumentRemoved((DDPSubscription.Removed) docEvent);
onDocumentChanged((DDPSubscription.Changed) docEvent); } else if (docEvent instanceof DDPSubscription.Changed) {
} else if (docEvent instanceof DDPSubscription.MovedBefore) { onDocumentChanged((DDPSubscription.Changed) docEvent);
//ignore movedBefore } else if (docEvent instanceof DDPSubscription.MovedBefore) {
//ignore movedBefore
}
} catch (Exception exception) {
RCLog.w(exception, "failed to handle subscription callback");
}
},
throwable -> {
} }
} catch (Exception exception) { );
RCLog.w(exception, "failed to handle subscription callback");
}
});
} }
protected void onDocumentAdded(DDPSubscription.Added docEvent) { protected void onDocumentAdded(DDPSubscription.Added docEvent) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment