Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Propagating back-end error message to front-end.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirmal070125 committed Jun 12, 2015
1 parent d1e8dfc commit 0d7428d
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 61 deletions.
12 changes: 6 additions & 6 deletions modules/jaggeryapps/ml/site/algorithm/algorithm.jag
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ $( document ).ready(function() {
setResponseVariable = res;
},
error: function(res) {
var errorText = 'Error occurred while retrieving previously set response variable. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, notificationArea, 'warning');
}
});
Expand All @@ -208,7 +208,7 @@ $( document ).ready(function() {
}
},
error: function(res) {
var errorText = 'Error occurred while retrieving previously set algorithm name. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, notificationArea, 'warning');
}
});
Expand All @@ -228,7 +228,7 @@ $( document ).ready(function() {
}
},
error: function(res) {
var errorText = 'Error occurred while retrieving previously set train data fraction. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, notificationArea, 'warning');
}
});
Expand Down Expand Up @@ -293,7 +293,7 @@ $( document ).ready(function() {
window.location.href = '../parameters/parameters.jag?analysisId='+analysisId+'&projectName='+projectName+'&analysisName='+analysisName+'&algorithmName='+algorithmName+'&algorithmType='+algorithmType+'&datasetId='+datasetId+'&fromAnalysis='+fromAnalysis;
},
error: function(res){
var errorText = 'Error occurred while setting model configurations. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, notificationArea, 'warning');
}
});
Expand All @@ -312,7 +312,7 @@ $( document ).ready(function() {
window.location.href = '../project/projects.jag';
},
error: function(res){
var errorText = 'Error occurred while cancelling analysis. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, notificationArea, 'warning');
}
});
Expand Down Expand Up @@ -340,7 +340,7 @@ function loadDatasetFeatures(setResponseVariable) {
}
},
error: function(res) {
var errorText = 'Error occurred while retrieving dataset features. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, notificationArea, 'warning');
}
});
Expand Down
10 changes: 5 additions & 5 deletions modules/jaggeryapps/ml/site/analysis/analysis.jag
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
}
},
error: function(res) {
var errorText = 'Error occurred while retrieving analysis models. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -390,7 +390,7 @@
handleNotification(successText, '#notification-area', 'success');
},
error : function(res){
var errorText = 'Error occurred while publishing model to registry. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -421,7 +421,7 @@
algorithmName = res;
},
error : function(res){
var errorText = 'Error occurred while retrieving analysis name. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -438,7 +438,7 @@
algorithmType = res;
},
error : function(res){
var errorText = 'Error occurred while retrieving algorithm type. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -464,7 +464,7 @@
$('#accordion').pageMe({pagerSelector:'#pagination-list', childSelector:'.panel', showPrevNext:true, hidePageNumbers:false, perPage:panelsPerPage});
},
error : function(res){
var errorText = 'Error occurred while deleting model. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
6 changes: 3 additions & 3 deletions modules/jaggeryapps/ml/site/analysis/view-model.jag
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ $( document ).ready(function() {
numericalFeatureNames = res;
},
error : function(res){
var errorText = 'Error occurred while retrieving numerical feature names. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -282,7 +282,7 @@ $( document ).ready(function() {
responseVariable = res;
},
error : function(res){
var errorText = 'Error occurred while retrieving response variable. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -404,7 +404,7 @@ $( document ).ready(function() {
}
},
error: function(res){
var errorText = 'Error occurred while retrieving model summary. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
2 changes: 1 addition & 1 deletion modules/jaggeryapps/ml/site/data/createdataset.jag
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ $( document ).ready(function() {
window.location = baseUrl + '/ml/site/data/datasets.jag';
},
error : function(res){
var errorText = 'Error occurred while creating dataset. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
2 changes: 1 addition & 1 deletion modules/jaggeryapps/ml/site/data/createversion.jag
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ $( document ).ready(function() {
window.location = baseUrl + '/ml/site/data/datasets.jag';
},
error : function(res){
var errorText = 'Error occurred while creating dataset version. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
6 changes: 3 additions & 3 deletions modules/jaggeryapps/ml/site/data/datasets.jag
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ function loadDatasets() {
}
},
error : function(res){
var errorText = 'Error occurred while retrieving datasets. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -370,7 +370,7 @@ function deleteDataset(datasetId) {
loadDatasets();
},
error : function(res){
var errorText = 'Error occurred while deleting dataset. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -390,7 +390,7 @@ function deleteDatasetVersion(versionId) {
loadDatasets();
},
error : function(res){
var errorText = 'Error occurred while deleting dataset version. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
14 changes: 7 additions & 7 deletions modules/jaggeryapps/ml/site/data/explore.jag
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ $( document ).ready(function() {
categoricalFeatureNames = res;
},
error : function(res) {
var errorText = 'Error occurred while retrieving categorical feature names. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -469,7 +469,7 @@ $( document ).ready(function() {
numericalFeatureNames = res;
},
error : function(res) {
var errorText = 'Error occurred while retrieving numerical feature names. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -620,7 +620,7 @@ function drawPlotsAjax() {
$("#scatterPlotTitle").html(numFeatureIndependent + " vs. " + numFeatureDependent);
},
error : function(res){
var errorText = 'Error occurred while retrieving scatter plot data. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -645,7 +645,7 @@ function drawPlotsAjax() {
drawHistogram(jsonObj, "#histogramIndependent");
},
error : function(res){
var errorText = 'Error occurred while retrieving summary data for independent variable. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -670,7 +670,7 @@ function drawPlotsAjax() {
drawHistogram(jsonObj, "#histogramDependent");
},
error : function(res){
var errorText = 'Error occurred while retrieving summary data for dependent variable. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -767,7 +767,7 @@ function drawParallelSets() {
vis.datum(res).call(chart);
},
error : function(res){
var errorText = 'Error occurred while retrieving data for parallel sets. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -964,7 +964,7 @@ function drawTrellisChart() {
// array for parsets dimensions with categorical feature names
},
error : function(res){
var errorText = 'Error occurred while retrieving data for trellis chart. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
20 changes: 10 additions & 10 deletions modules/jaggeryapps/ml/site/explore/explore.jag
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ $( document ).ready(function() {
projectId = res['id'];
},
error: function(res){
var errorText = 'Error occurred while retrieving project info. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -473,7 +473,7 @@ $( document ).ready(function() {
userName = res['userName'];
},
error: function(res){
var errorText = 'Error occurred while retrieving analysis info. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -490,7 +490,7 @@ $( document ).ready(function() {
categoricalFeatureNames = res;
},
error : function(res){
var errorText = 'Error occurred while retrieving categorical feature names. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -506,7 +506,7 @@ $( document ).ready(function() {
numericalFeatureNames = res;
},
error : function(res){
var errorText = 'Error occurred while retrieving numerical feature names. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -571,7 +571,7 @@ $( document ).ready(function() {
window.location.href = '../project/projects.jag';
},
error: function(res){
var errorText = 'Error occurred while cancelling analysis. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -689,7 +689,7 @@ function drawPlotsAjax() {
$("#scatterPlotTitle").html(numFeatureIndependent + " vs. " + numFeatureDependent);
},
error : function(res){
var errorText = 'Error occurred while retrieving scatter plot data. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -714,7 +714,7 @@ function drawPlotsAjax() {
drawHistogram(jsonObj, "#histogramIndependent");
},
error : function(res){
var errorText = 'Error occurred while retrieving summary data for independent variable. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -739,7 +739,7 @@ function drawPlotsAjax() {
drawHistogram(jsonObj, "#histogramDependent");
},
error : function(res){
var errorText = 'Error occurred while retrieving summary data for dependent variable. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -836,7 +836,7 @@ function drawParallelSets() {
vis.datum(res).call(chart);
},
error : function(res){
var errorText = 'Error occurred while retrieving data for parallel sets. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down Expand Up @@ -1033,7 +1033,7 @@ function drawTrellisChart() {
// array for parsets dimensions with categorical feature names
},
error : function(res){
var errorText = 'Error occurred while retrieving data for trellis chart. '+res.status+' '+res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
10 changes: 5 additions & 5 deletions modules/jaggeryapps/ml/site/model/model.jag
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ $( document ).ready(function() {
modelName = res['name'];
},
error: function(res){
var errorText = 'Error occurred while creating model. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -190,7 +190,7 @@ $( document ).ready(function() {
modelId = res['id'];
},
error: function(res){
var errorText = 'Error occurred while retrieving model info. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -207,7 +207,7 @@ $( document ).ready(function() {
window.location.href = '../analysis/analysis.jag?analysisId='+analysisId+'&analysisName='+analysisName+'&projectName='+projectName+'&datasetId='+datasetId;
},
error: function(res){
var errorText = 'Error occurred while submitting model build job. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -232,7 +232,7 @@ $( document ).ready(function() {
window.location.href = '../project/projects.jag';
},
error: function(res){
var errorText = 'Error occurred while cancelling analysis. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand All @@ -257,7 +257,7 @@ function loadDatasetVersions() {
});
},
error: function(res) { //TODO: display error
var errorText = 'Error occurred while retrieving dataset versions. ' + res.status + ' ' + res.statusText;
var errorText = res.responseText
handleNotification(errorText, '#notification-area', 'warning');
}
});
Expand Down
Loading

0 comments on commit 0d7428d

Please sign in to comment.