From c352ac9298dceab173b9a13d2530c3fa0ee51e18 Mon Sep 17 00:00:00 2001 From: Nathan Franklin Date: Thu, 5 Sep 2024 11:28:52 -0500 Subject: [PATCH] Improve error message when duplicate syncing project --- .../modal-create-project.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/angular/src/app/components/modal-create-project/modal-create-project.component.ts b/angular/src/app/components/modal-create-project/modal-create-project.component.ts index a0aa7885..e604589f 100644 --- a/angular/src/app/components/modal-create-project/modal-create-project.component.ts +++ b/angular/src/app/components/modal-create-project/modal-create-project.component.ts @@ -88,8 +88,12 @@ export class ModalCreateProjectComponent implements OnInit, AfterContentChecked this.close(project); }, (err) => { - this.errorMessage = err.error && err.error.message ? err.error.message : 'That folder is already syncing with a different map!'; - + if (err.status === 409) { + this.errorMessage = 'That folder is already syncing with a different map!'; + } else { + this.errorMessage = + err.error && err.error.message ? err.error.message : 'An error occurred while creating the project. Please contact support.'; + } this.submitting = false; } );