Commit 38b8247e authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

catch exceptions in loadData().

parent 53b6fdaa
...@@ -236,6 +236,11 @@ ...@@ -236,6 +236,11 @@
}); });
var loadData = function (data) { var loadData = function (data) {
dream_instance.clearAll();
$('#graph_zone').hide();
$('#spreadsheet_output').hide();
try {
// spreadsheet // spreadsheet
var spreadsheet_data = data.spreadsheet; var spreadsheet_data = data.spreadsheet;
if (spreadsheet_data !== undefined) { if (spreadsheet_data !== undefined) {
...@@ -277,6 +282,9 @@ ...@@ -277,6 +282,9 @@
} else { } else {
dream_instance.redraw(); dream_instance.redraw();
} }
} catch (e) {
alert('Loading data failed.');
}
}; };
// Check if there is already data when we first load the page, if yes, then build graph from it // Check if there is already data when we first load the page, if yes, then build graph from it
jio.get({ jio.get({
...@@ -461,7 +469,6 @@ ...@@ -461,7 +469,6 @@
$("#import_file").change(function () { $("#import_file").change(function () {
var form = $(this).parent('form')[0]; var form = $(this).parent('form')[0];
var form_data = new FormData(form); var form_data = new FormData(form);
dream_instance.clearAll();
$.ajax('/postJSONFile', { $.ajax('/postJSONFile', {
type: 'POST', type: 'POST',
contentType: false, contentType: false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment