Skip to content
Browse files

Catch errors from sending

  • Loading branch information...
1 parent 8ca4f98 commit 7224f1c882fea661291564dc7f8871057599a606 @BerkeleyTrue BerkeleyTrue committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/index.js
View
8 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

Please sign in to comment.
Something went wrong with that request. Please try again.