aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
diff options
context:
space:
mode:
authorShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-10-21 10:08:19 +0200
committerShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-10-21 11:30:30 +0200
commita03d4f6e227d1dbe9f1fa79365f4c6da73f609d9 (patch)
treeebfcfbd52925594d653b9e2a3c5ad31701089031 /cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
parent83c0cd2c078f89a386701b7f8e680fd3fc70ecfd (diff)
fixing forming cba package definition
Issue-ID: CCSDK-2928 Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com> Change-Id: If45b35e9077246faac7490291879df419e0d5ff5
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts19
1 files changed, 16 insertions, 3 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
index dc5697f78..a78fe4ed1 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
@@ -19,7 +19,7 @@ import {PackageCreationService} from '../package-creation/package-creation.servi
import {ComponentCanDeactivate} from '../../../../common/core/canDactivate/ComponentCanDeactivate';
import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service';
import {distinctUntilChanged, takeUntil} from 'rxjs/operators';
-import {Subject} from 'rxjs';
+import {Subject, throwError} from 'rxjs';
@Component({
selector: 'app-configuration-dashboard',
@@ -264,8 +264,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
this.router.navigate(['/packages/package/' + id]);
});
}, error => {
- this.toastService.error('error happened when deploying ' + error.message);
- console.log('Error -' + error.message);
+ this.handleError(error);
});
}
@@ -291,5 +290,19 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl
this.dataTarget = '#exampleModalLong';
}
}
+
+ handleError(error) {
+ let errorMessage = '';
+ if (error.error instanceof ErrorEvent) {
+ // client-side error
+ errorMessage = `Error: ${error.error.message}`;
+ } else {
+ // server-side error
+ errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`;
+ }
+ this.toastService.error('error happened when deploying ' + errorMessage);
+ console.log('Error -' + errorMessage);
+ return throwError(errorMessage);
+ }
}