Fixed error handling

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@144526 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-03-02 12:00:11 +00:00
parent be132b8355
commit 7004cf1568
1 changed files with 86 additions and 2 deletions

View File

@ -459,9 +459,15 @@ public class AccountingManagerController {
caught.printStackTrace(); caught.printStackTrace();
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
caught.getLocalizedMessage()); caught.getLocalizedMessage());
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent( StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Restore, accountingState StateChangeType.Restore, accountingState.getState(accountingType));
.getState(accountingType));
eventBus.fireEvent(stateChangeEvent); eventBus.fireEvent(stateChangeEvent);
} }
@ -485,6 +491,13 @@ public class AccountingManagerController {
Log.error("Invalid Operation Id: " + operationId); Log.error("Invalid Operation Id: " + operationId);
UtilsGXT3.alert("Error", "Invalid Operation Id: " UtilsGXT3.alert("Error", "Invalid Operation Id: "
+ operationId); + operationId);
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent( StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Restore, accountingState StateChangeType.Restore, accountingState
.getState(accountingType)); .getState(accountingType));
@ -505,6 +518,13 @@ public class AccountingManagerController {
caught.printStackTrace(); caught.printStackTrace();
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
caught.getLocalizedMessage()); caught.getLocalizedMessage());
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent( StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Restore, accountingState StateChangeType.Restore, accountingState
.getState(accountingType)); .getState(accountingType));
@ -565,6 +585,13 @@ public class AccountingManagerController {
caught.printStackTrace(); caught.printStackTrace();
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
caught.getLocalizedMessage()); caught.getLocalizedMessage());
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent( StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Restore, StateChangeType.Restore,
accountingState accountingState
@ -583,6 +610,13 @@ public class AccountingManagerController {
accountingMonitor.hide(); accountingMonitor.hide();
Log.error("Error: TimeOut!"); Log.error("Error: TimeOut!");
UtilsGXT3.alert("Error Time Out", "Time Out"); UtilsGXT3.alert("Error Time Out", "Time Out");
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent( StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Restore, StateChangeType.Restore,
accountingState.getState(accountingType)); accountingState.getState(accountingType));
@ -662,6 +696,16 @@ public class AccountingManagerController {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
caught.getLocalizedMessage()); caught.getLocalizedMessage());
caught.printStackTrace(); caught.printStackTrace();
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Update, accountingState.getState(accountingType));
eventBus.fireEvent(stateChangeEvent);
} }
} }
@ -683,6 +727,16 @@ public class AccountingManagerController {
Log.error("Invalid Operation Id: " + operationId); Log.error("Invalid Operation Id: " + operationId);
UtilsGXT3.alert("Error", "Invalid Operation Id: " UtilsGXT3.alert("Error", "Invalid Operation Id: "
+ operationId); + operationId);
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Update, accountingState.getState(accountingType));
eventBus.fireEvent(stateChangeEvent);
} else { } else {
operationMonitor(operationId); operationMonitor(operationId);
} }
@ -699,6 +753,16 @@ public class AccountingManagerController {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
caught.getLocalizedMessage()); caught.getLocalizedMessage());
caught.printStackTrace(); caught.printStackTrace();
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Update, accountingState.getState(accountingType));
eventBus.fireEvent(stateChangeEvent);
} }
} }
@ -754,6 +818,16 @@ public class AccountingManagerController {
UtilsGXT3.alert("Error", UtilsGXT3.alert("Error",
caught.getLocalizedMessage()); caught.getLocalizedMessage());
caught.printStackTrace(); caught.printStackTrace();
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Update, accountingState.getState(accountingType));
eventBus.fireEvent(stateChangeEvent);
} }
} }
@ -766,6 +840,16 @@ public class AccountingManagerController {
accountingMonitor.hide(); accountingMonitor.hide();
Log.error("Error: TimeOut!"); Log.error("Error: TimeOut!");
UtilsGXT3.alert("Error Time Out", "Time Out"); UtilsGXT3.alert("Error Time Out", "Time Out");
AccountingClientStateData accountingStateData = accountingState
.getState(accountingType);
accountingStateData
.setSeriesResponse(null);
accountingState.setState(
accountingType,
accountingStateData);
StateChangeEvent stateChangeEvent = new StateChangeEvent(
StateChangeType.Update, accountingState.getState(accountingType));
eventBus.fireEvent(stateChangeEvent);
break; break;
} }