Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

Commit

Permalink
Add onFailure() for enable deployment to hide modal dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
hpehl committed Dec 20, 2012
1 parent 60e32e0 commit 4f2a9c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Expand Up @@ -128,6 +128,7 @@ public void onSuccess(final ContentRepository result)
@Override
public void enableDisableDeployment(final DeploymentRecord record)
{
// TODO Distinguish between enable and disable and user proper messages
final PopupPanel loading = Feedback.loading(
Console.CONSTANTS.common_label_plaseWait(),
Console.CONSTANTS.common_label_requestProcessed(),
Expand All @@ -143,12 +144,17 @@ public void onCancel()
deploymentStore.enableDisableDeployment(record, new SimpleCallback<DMRResponse>()
{
@Override
public void onSuccess(DMRResponse response)
public void onFailure(final Throwable caught)
{
loading.hide();
Console.error(Console.MESSAGES.modificationFailed("Deployment " + record.getRuntimeName()), caught.getMessage());
}

@Override
public void onSuccess(DMRResponse response)
{
loading.hide();
ModelNode result = response.get();

if (result.isFailure())
{
Console.error(Console.MESSAGES.modificationFailed("Deployment " + record.getRuntimeName()),
Expand All @@ -161,7 +167,6 @@ public void onSuccess(DMRResponse response)
refreshDeployments();
}
});

}

@Override
Expand Down
Expand Up @@ -154,6 +154,7 @@ public void onFailure(Throwable t)
@Override
public void enableDisableDeployment(final DeploymentRecord record)
{
// TODO Distinguish between enable and disable and user proper messages
final PopupPanel loading = Feedback.loading(
Console.CONSTANTS.common_label_plaseWait(),
Console.CONSTANTS.common_label_requestProcessed(),
Expand All @@ -168,6 +169,13 @@ public void onCancel()

deploymentStore.enableDisableDeployment(record, new SimpleCallback<DMRResponse>()
{
@Override
public void onFailure(final Throwable caught)
{
loading.hide();
Console.error(Console.MESSAGES.modificationFailed("Deployment " + record.getRuntimeName()), caught.getMessage());
}

@Override
public void onSuccess(DMRResponse response)
{
Expand Down

0 comments on commit 4f2a9c0

Please sign in to comment.