From b34879b4f6712ad0752ff8b448800b06b00386bf Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 2 Nov 2015 22:46:06 -0800 Subject: [PATCH] New: Manual search shows error when download fails --- src/UI/Release/DownloadReportCell.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/UI/Release/DownloadReportCell.js b/src/UI/Release/DownloadReportCell.js index 4f91b817a..c422446fc 100644 --- a/src/UI/Release/DownloadReportCell.js +++ b/src/UI/Release/DownloadReportCell.js @@ -14,15 +14,23 @@ module.exports = Backgrid.Cell.extend({ var self = this; - this.$el.html(''); + this.$el.html(''); //Using success callback instead of promise so it //gets called before the sync event is triggered - this.model.save(null, { + var promise = this.model.save(null, { success : function() { self.model.set('queued', true); } }); + + promise.fail(function (xhr) { + if (xhr.responseJSON && xhr.responseJSON.message) { + self.$el.html(''.format(xhr.responseJSON.message)); + } else { + self.$el.html(''); + } + }); }, render : function() {