diff options
author | Struan Donald <struan@exo.org.uk> | 2013-06-28 15:00:17 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-06-28 15:00:17 +0100 |
commit | e98e97f47b2018d2e49e3b5601b296ffda862353 (patch) | |
tree | 6c68b4452ec066f13d7e424c4bdf1310f4dfa06e | |
parent | 0620cb76d958a4cbe708b48651f763ff17b6eddf (diff) |
slightly improved reporting error messages
-rw-r--r-- | www/js/models/report.js | 2 | ||||
-rw-r--r-- | www/js/strings.js | 3 | ||||
-rw-r--r-- | www/js/views/submit.js | 6 |
3 files changed, 8 insertions, 3 deletions
diff --git a/www/js/models/report.js b/www/js/models/report.js index 9ddcc66..85d6e93 100644 --- a/www/js/models/report.js +++ b/www/js/models/report.js @@ -141,7 +141,7 @@ }, error: function (data, status, errorThrown ) { console.log(FMS.strings.report_send_error); - options.error( data ); + options.error( data, status, errorThrown ); } } ); } diff --git a/www/js/strings.js b/www/js/strings.js index 40b3835..632d8bf 100644 --- a/www/js/strings.js +++ b/www/js/strings.js @@ -27,7 +27,8 @@ location_error: 'Location error', location_problem: 'There was a problem looking up your location', multiple_locations: 'More than one location matched that name. Select one below or try entering street name and area, or a postcode.', - sync_error: 'Sync error', + sync_error: 'An error was encountered when submitting your report: ', + unknown_sync_error: 'There was a problem submitting your report. Please try again later.', report_send_error: 'There was a problem submitting your report. Please try again', missing_location: 'Please enter a location', location_check_failed: 'Could not check your location', diff --git a/www/js/views/submit.js b/www/js/views/submit.js index 6b7529e..a2cf880 100644 --- a/www/js/views/submit.js +++ b/www/js/views/submit.js @@ -93,7 +93,11 @@ }, onReportError: function(model, err, options) { - alert( FMS.strings.sync_error + ': ' + err.errors); + if ( err.errors ) { + alert( FMS.strings.sync_error + ': ' + err.errors); + } else { + alert( FMS.strings.unknown_sync_error ); + } }, beforeSubmit: function() {}, |