Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error management #338

Merged
merged 6 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"jsrsasign": "^10.4.1",
"jsrsasign-util": "^1.0.5",
"live-server": "^1.2.1",
"marked": "^3.0.7",
"marked": "^3.0.8",
"ng-apexcharts": "^1.5.12",
"ng-multiselect-dropdown": "^0.3.4",
"ngx-countup": "^7.3.3",
Expand All @@ -72,15 +72,15 @@
"@cypress/webpack-preprocessor": "^5.9.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/datatables.net": "^1.10.21",
"@types/jasmine": "~3.10.0",
"@types/jasmine": "~3.10.1",
"@types/jasminewd2": "~2.0.10",
"@types/jquery": "^3.5.8",
"@types/node": "^16.11.4",
"codelyzer": "^6.0.2",
"cypress": "^7.7.0",
"istanbul-instrumenter-loader": "^3.0.1",
"istanbul-lib-coverage": "^3.2.0",
"jasmine-core": "~3.10.0",
"jasmine-core": "~3.10.1",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.5",
"karma-chrome-launcher": "~3.1.0",
Expand Down
8 changes: 4 additions & 4 deletions src/app/admin-applications/admin-applications.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class AdminApplicationsComponent implements AfterViewInit, OnDestroy, OnI
this.toastService.showSuccess(`L'application ${result.name} a bien été ajoutée`);
this.refreshApplication();
}, (reason) => {
if (reason.message !== undefined) {
this.toastService.showError(`Une erreur est survenue lors de l'ajout de l'application : ${reason.message}`);
if (reason.apierror.message !== undefined) {
this.toastService.showError(`Une erreur est survenue lors de l'ajout de l'application : ${reason.apierror.message}`);
}
});
modalRef.componentInstance.isUpdate = false;
Expand All @@ -132,8 +132,8 @@ export class AdminApplicationsComponent implements AfterViewInit, OnDestroy, OnI
this.toastService.showSuccess(`L'application ${result.name} a bien été modifiée`);
this.refreshApplication();
}, (reason) => {
if (reason.message !== undefined) {
this.toastService.showError(`Une erreur est survenue lors de la modification de l'application : ${reason.message}`);
if (reason.apierror.message !== undefined) {
this.toastService.showError(`Une erreur est survenue lors de la modification de l'application : ${reason.apierror.message}`);
}
});
modalRef.componentInstance.application = {...app};
Expand Down
10 changes: 5 additions & 5 deletions src/app/admin-identities/admin-identities.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export class AdminIdentitiesComponent implements AfterViewInit, OnDestroy, OnIni
this.translateService.get('IDENTITY.MSG.ADD_SUCCESS').subscribe((msg) => this.toastService.showSuccess(msg));
this.refreshIdentities();
}, (reason) => {
if (reason.message !== undefined) {
this.translateService.get('IDENTITY.MSG.ADD_ERROR', {msg: reason.message}).subscribe((msg) => this.toastService.showError(msg));
if (reason.apierror.message !== undefined) {
this.translateService.get('IDENTITY.MSG.ADD_ERROR', {msg: reason.apierror.message}).subscribe((msg) => this.toastService.showError(msg));
}
});
modalRef.componentInstance.isUpdate = false;
Expand All @@ -106,8 +106,8 @@ export class AdminIdentitiesComponent implements AfterViewInit, OnDestroy, OnIni
this.translateService.get('IDENTITY.MSG.UPDATE_SUCCESS').subscribe((msg) => this.toastService.showSuccess(msg));
this.refreshIdentities();
}, (reason) => {
if (reason.message !== undefined) {
this.translateService.get('IDENTITY.MSG.UPDATE_ERROR', {msg: reason.message})
if (reason.apierror.message !== undefined) {
this.translateService.get('IDENTITY.MSG.UPDATE_ERROR', {msg: reason.apierror.message})
.subscribe((msg) => this.toastService.showError(msg));
}
});
Expand All @@ -124,7 +124,7 @@ export class AdminIdentitiesComponent implements AfterViewInit, OnDestroy, OnIni
this.refreshIdentities();
},
reason => {
this.translateService.get('IDENTITY.MSG.DELETION_ERROR', {msg: reason.message})
this.translateService.get('IDENTITY.MSG.DELETION_ERROR', {msg: reason.apierror.message})
.subscribe((msg) => this.toastService.showError(msg)); }
);
});
Expand Down
8 changes: 4 additions & 4 deletions src/app/admin-news/admin-news.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export class AdminNewsComponent implements AfterViewInit, OnDestroy, OnInit {
this.toastService.showSuccess(`L'actualité a bien été ajoutée`);
this.refreshNews();
}, (reason) => {
if (reason.message !== undefined) {
this.toastService.showError( `Une erreur est survenue lors de l'ajout de l'actualité : ${reason.message}`);
if (reason.apierror.message !== undefined) {
this.toastService.showError( `Une erreur est survenue lors de l'ajout de l'actualité : ${reason.apierror.message}`);
}
});
modalRef.componentInstance.isUpdate = false;
Expand All @@ -104,8 +104,8 @@ export class AdminNewsComponent implements AfterViewInit, OnDestroy, OnInit {
this.toastService.showSuccess(`L'actualité a bien été modifiée`);
this.refreshNews();
}, (reason) => {
if (reason.message !== undefined) {
this.toastService.showError( `Une erreur est survenue lors de la modification de l'actualité : ${reason.message}`);
if (reason.apierror.message !== undefined) {
this.toastService.showError( `Une erreur est survenue lors de la modification de l'actualité : ${reason.apierror.message}`);
}
});
modalRef.componentInstance.oneNew = {...oneNew};
Expand Down
Loading