Skip to content

Commit

Permalink
Cleaner save error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Irwin committed Jan 9, 2014
1 parent ba66843 commit e992d20
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ function ready() {
*/

return '/';
})();
})(),
error = 'You must be connected to the National Park Service network to save a map.';

Builder.showLoading();
$this.blur();
Expand All @@ -671,11 +672,11 @@ function ready() {
name: $('.title a').text() || null
},
dataType: 'json',
error: function () {
error: function() {
Builder.hideLoading();
alertify.error('Cannot reach status service. You must be connected to the National Park Service network to save a map.');
alertify.error(error);
},
success: function (response) {
success: function(response) {
Builder.hideLoading();

if (response) {
Expand All @@ -684,10 +685,10 @@ function ready() {
updateSaveStatus(response.modified);
alertify.success('Your map was saved!');
} else {
alertify.error('Your map was not saved.');
alertify.error('Sorry, but there was an error saving your map. Please try again.');
}
} else {
alertify.error('Cannot reach status service. You must be connected to the National Park Service network to save a map.');
alertify.error(error);
}
},
url: base + 'builder/save' + (base === '/' ? '' : '&callback=?')
Expand Down

0 comments on commit e992d20

Please sign in to comment.