Skip to content

Commit

Permalink
feat(rstream): add Subscription.done() error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 8, 2019
1 parent bbb96ba commit c911006
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/rstream/src/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,14 @@ export class Subscription<A, B>
}
this.state = State.DONE;
for (let s of [...this.subs]) {
s.done && s.done();
try {
s.done && s.done();
} catch (e) {
s.error ? s.error(e) : this.error(e);
}
}
this.unsubscribe();
LOGGER.debug(this.id, "done");
LOGGER.debug(this.id, "exiting done()");
}
}

Expand Down

0 comments on commit c911006

Please sign in to comment.