Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error when failing to communicate with server #1121

Merged
merged 2 commits into from
Jun 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions rd_ui/app/scripts/services/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@
refreshStatus(queryResult, query);
}, 3000);
}
})
}, function(error) {
console.log("Connection error", error);
queryResult.update({job: {error: 'failed communicating with server. Please check your Internet connection and try again.', status: 4}})
});
}

QueryResult.getById = function (id) {
Expand Down Expand Up @@ -413,6 +416,9 @@
queryResult.update(error.data);
} else if (error.status === 400 && 'job' in error.data) {
queryResult.update(error.data);
} else {
console.log("Unknown error", error);
queryResult.update({job: {error: 'unknown error occurred. Please try again later.', status: 4}})
}
});

Expand Down Expand Up @@ -586,7 +592,7 @@
this.cachedQueryText = this.query.query;
var parameterNames = this.parseQuery();

this.query.options.parameters = this.query.options.parameters || {};
this.query.options.parameters = this.query.options.parameters || [];

var parametersMap = {};
_.each(this.query.options.parameters, function(param) {
Expand Down