From f384efdc27021537db9cbe4e5185e8c3540a21f7 Mon Sep 17 00:00:00 2001 From: Florent BENOIT Date: Wed, 2 Mar 2016 14:12:41 +0100 Subject: [PATCH] CHE-689 report error when starting agent Change-Id: I9b49b687c64e58390591b2b268be0afcb71cfd7b Signed-off-by: Florent BENOIT --- dashboard/src/app/ide/ide.service.js | 13 +++++++++++++ .../create-project/create-project.controller.js | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/dashboard/src/app/ide/ide.service.js b/dashboard/src/app/ide/ide.service.js index 85625e3f8d..306890690e 100644 --- a/dashboard/src/app/ide/ide.service.js +++ b/dashboard/src/app/ide/ide.service.js @@ -173,6 +173,19 @@ class IdeSvc { } let agentStep = 2; + + if (message.eventType === 'ERROR' && message.workspaceId === data.id) { + this.steps[agentStep].hasError = true; + // need to show the error + this.$mdDialog.show( + this.$mdDialog.alert() + .title('Error when starting agent') + .content('Unable to start workspace agent. Error when trying to start the workspace agent: ' + message.error) + .ariaLabel('Workspace agent start') + .ok('OK') + ); + } + if (this.steps[agentStep].logs.length > 0) { this.steps[agentStep].logs = this.steps[agentStep].logs + '\n' + message; } else { diff --git a/dashboard/src/app/projects/create-project/create-project.controller.js b/dashboard/src/app/projects/create-project/create-project.controller.js index 8bb83718d9..e5ed3e65c5 100755 --- a/dashboard/src/app/projects/create-project/create-project.controller.js +++ b/dashboard/src/app/projects/create-project/create-project.controller.js @@ -855,6 +855,20 @@ export class CreateProjectCtrl { this.listeningChannels.push(workspaceChannel); bus.subscribe(workspaceChannel, (message) => { + if (message.eventType === 'ERROR' && message.workspaceId === data.id) { + this.createProjectSvc.setCurrentProgressStep(2); + this.getCreationSteps()[this.getCurrentProgressStep()].hasError = true; + // need to show the error + this.$mdDialog.show( + this.$mdDialog.alert() + .title('Error when starting agent') + .content('Unable to start workspace agent. Error when trying to start the workspace agent: ' + message.error) + .ariaLabel('Workspace agent start') + .ok('OK') + ); + } + + if (message.eventType === 'RUNNING' && message.workspaceId === data.id) { this.createProjectSvc.setCurrentProgressStep(2);