improve error handling

This commit is contained in:
Sebastian Sdorra
2010-12-19 15:13:45 +01:00
parent 6a469d134e
commit 6103e27cfe
5 changed files with 67 additions and 12 deletions

View File

@@ -139,7 +139,12 @@ Sonia.config.ScmConfigPanel = Ext.extend(Sonia.config.ConfigPanel,{
failure: function(){
el.unmask();
clearTimeout(tid);
alert('failure');
Ext.MessageBox.show({
title: 'Error',
msg: 'Could not load config.',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
}

View File

@@ -90,8 +90,13 @@ Sonia.plugin.installPlugin = function(pluginId){
if ( debug ){
console.debug('plugin installation failed');
}
alert( 'failure' );
loadingBox.hide();
Ext.MessageBox.show({
title: 'Error',
msg: 'Plugin installation failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
}
@@ -127,8 +132,13 @@ Sonia.plugin.uninstallPlugin = function(pluginId){
if ( debug ){
console.debug('plugin uninstallation failed');
}
alert( 'failure' );
loadingBox.hide();
Ext.MessageBox.show({
title: 'Error',
msg: 'Plugin uninstallation failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
}
@@ -162,10 +172,15 @@ Sonia.plugin.updatePlugin = function(pluginId){
},
failure: function(){
if ( debug ){
console.debug('plugin updated failed');
console.debug('plugin update failed');
}
alert( 'failure' );
loadingBox.hide();
Ext.MessageBox.show({
title: 'Error',
msg: 'Plugin update failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
}

View File

@@ -357,7 +357,12 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
failure: function(){
clearTimeout(tid);
el.unmask();
alert( 'failure' );
Ext.MessageBox.show({
title: 'Error',
msg: 'Repository update failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
},
@@ -390,7 +395,12 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
failure: function(){
clearTimeout(tid);
el.unmask();
alert( 'failure' );
Ext.MessageBox.show({
title: 'Error',
msg: 'Repository creation failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
},
@@ -486,7 +496,12 @@ Sonia.repository.Panel = Ext.extend(Ext.Panel, {
this.resetPanel();
},
failure: function(){
alert( 'failure' );
Ext.MessageBox.show({
title: 'Error',
msg: 'Repository deletion failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
}

View File

@@ -47,7 +47,12 @@ Sonia.rest.JsonStore = Ext.extend( Ext.data.JsonStore, {
}
this.removeAll();
} else {
alert( action + "(" + status + "): " + response.responseText );
Ext.MessageBox.show({
title: 'Error',
msg: 'Could not load items. Server returned status: ' + status,
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
},
scope: this

View File

@@ -207,7 +207,12 @@ Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
this.execCallback(this.onUpdate, item);
},
failure: function(){
alert( 'failure' );
Ext.MessageBox.show({
title: 'Error',
msg: 'User update failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
@@ -233,7 +238,12 @@ Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
this.execCallback(this.onCreate, user);
},
failure: function(){
alert( 'failure' );
Ext.MessageBox.show({
title: 'Error',
msg: 'User creation failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
},
@@ -343,7 +353,12 @@ Sonia.user.Panel = Ext.extend(Ext.Panel, {
this.resetPanel();
},
failure: function(){
alert( 'failure' );
Ext.MessageBox.show({
title: 'Error',
msg: 'User deletion failed',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
});
}