From 0620f08a7cd1781e7e1eff4d7cce86b380012947 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 4 Dec 2015 12:02:19 -0800 Subject: [PATCH] Save single errors returned from send functions // FREEBIE --- js/models/messages.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/models/messages.js b/js/models/messages.js index 1f85fd999b38..044dd271156e 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -153,10 +153,16 @@ this.set({dataMessage: result.dataMessage}); } this.set({sent: true}); - this.saveErrors(result.errors); - if (result.successfulNumbers.length > 0) { - this.sendSyncMessage(); + + if (result instanceof Error) { + this.saveErrors(result); + } else { + this.saveErrors(result.errors); + if (result.successfulNumbers.length > 0) { + this.sendSyncMessage(); + } } + }.bind(this)); },