aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/models/report.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-07-22 18:32:58 +0100
committerStruan Donald <struan@exo.org.uk>2013-07-22 18:32:58 +0100
commit89c8b656e2f6247047c87c70bbcf8c3c47f5a0cc (patch)
treec347694d68a3a522c1e9719a97f0a3637fee3fbe /src/js/models/report.js
parent7253d58ae5aa6d222e8b1c421b6c88650b62da01 (diff)
improve handling of upload errors
Diffstat (limited to 'src/js/models/report.js')
-rw-r--r--src/js/models/report.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/js/models/report.js b/src/js/models/report.js
index 85d6e93..477d16c 100644
--- a/src/js/models/report.js
+++ b/src/js/models/report.js
@@ -100,8 +100,10 @@
}
if ( data.success ) {
that.trigger('sync', that, data, options);
- } else {
+ } else if ( data.errors ) {
that.trigger('invalid', that, data, options);
+ } else {
+ that.trigger('error', that, FMS.strings.report_send_error, options);
}
} else {
that.trigger('error', that, FMS.strings.report_send_error, options);
@@ -141,7 +143,7 @@
},
error: function (data, status, errorThrown ) {
console.log(FMS.strings.report_send_error);
- options.error( data, status, errorThrown );
+ that.trigger('error', that, data, status, errorThrown );
}
} );
}