[sqllab] async queries - better error handling (#1853)

This commit is contained in:
Maxime Beauchemin
2016-12-19 22:33:55 -08:00
committed by GitHub
parent 0712894353
commit 16731056ed
7 changed files with 26 additions and 17 deletions

View File

@@ -85,8 +85,12 @@ export function fetchQueryResults(query) {
success(results) {
dispatch(querySuccess(query, results));
},
error() {
dispatch(queryFailed(query, 'Failed at retrieving results from the results backend'));
error(err) {
let msg = 'Failed at retrieving results from the results backend';
if (err.responseJSON && err.responseJSON.error) {
msg = err.responseJSON.error;
}
dispatch(queryFailed(query, msg));
},
});
};