Permalink
Browse files
Catch errors from sending
- Loading branch information...
Showing
with
6 additions
and
2 deletions.
-
+6
−2
src/index.js
|
@@ -46,10 +46,14 @@ Observable.from(emails, null, null, Scheduler.default) |
|
|
text: createText({ email })
|
|
|
}
|
|
|
);
|
|
|
- return send$(filledOptions);
|
|
|
+ return send$(filledOptions)
|
|
|
+ .catch(e => {
|
|
|
+ console.log('encountered an error sending to %s', email, e.message);
|
|
|
+ return Observable.just(false);
|
|
|
+ });
|
|
|
})
|
|
|
.doOnNext(info => {
|
|
|
- lastEmail = info.envelope.to;
|
|
|
+ lastEmail = info && info.envelope ? info.envelope.to : lastEmail;
|
|
|
counter += 1;
|
|
|
console.log('%d percent done', getPercent(counter));
|
|
|
})
|
|
|
0 comments on commit
7224f1c