From 44c5d9c6f0de93b38437c0737d76a31dd1527f2c Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Thu, 11 Dec 2025 23:04:13 +0530 Subject: [PATCH 1/3] fix: amm-1931 handled empty error messgaes --- .../app-modules/lab/worklist/worklist.component.ts | 3 +++ .../doctor-worklist/doctor-worklist.component.ts | 11 ++++++++++- .../nurse-worklist/nurse-worklist.component.ts | 3 +++ .../pharmacist/worklist/worklist.component.ts | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/app/app-modules/lab/worklist/worklist.component.ts b/src/app/app-modules/lab/worklist/worklist.component.ts index b0b2fddc..d86ce9eb 100644 --- a/src/app/app-modules/lab/worklist/worklist.component.ts +++ b/src/app/app-modules/lab/worklist/worklist.component.ts @@ -139,6 +139,9 @@ export class WorklistComponent implements OnInit, OnDestroy, DoCheck { } }, (err) => { + if (err?.handled) { + return; + } this.confirmationService.alert(err, 'error'); }, ); diff --git a/src/app/app-modules/nurse-doctor/doctor-worklist/doctor-worklist.component.ts b/src/app/app-modules/nurse-doctor/doctor-worklist/doctor-worklist.component.ts index 1f22d77a..d9df39dd 100644 --- a/src/app/app-modules/nurse-doctor/doctor-worklist/doctor-worklist.component.ts +++ b/src/app/app-modules/nurse-doctor/doctor-worklist/doctor-worklist.component.ts @@ -195,9 +195,18 @@ export class DoctorWorklistComponent implements OnInit, DoCheck, OnDestroy { sectionCount.sno = index + 1; }); this.filterTerm = null; - } else this.confirmationService.alert(data.errorMessage, 'error'); + } else { + console.log('Error in else part', data.errorMessage); + + this.confirmationService.alert(data.errorMessage, 'error'); + } }, (err) => { + if (err?.handled) { + console.log('error handled'); + + return; + } this.confirmationService.alert(err, 'error'); }, ); diff --git a/src/app/app-modules/nurse-doctor/nurse-worklist-wrapper/nurse-worklist/nurse-worklist.component.ts b/src/app/app-modules/nurse-doctor/nurse-worklist-wrapper/nurse-worklist/nurse-worklist.component.ts index 3db39f97..2c36c372 100644 --- a/src/app/app-modules/nurse-doctor/nurse-worklist-wrapper/nurse-worklist/nurse-worklist.component.ts +++ b/src/app/app-modules/nurse-doctor/nurse-worklist-wrapper/nurse-worklist/nurse-worklist.component.ts @@ -123,6 +123,9 @@ export class NurseWorklistComponent implements OnInit, DoCheck, OnDestroy { } else this.confirmationService.alert(res.errorMessage, 'error'); }, (err) => { + if (err?.handled) { + return; + } this.confirmationService.alert(err, 'error'); }, ); diff --git a/src/app/app-modules/pharmacist/worklist/worklist.component.ts b/src/app/app-modules/pharmacist/worklist/worklist.component.ts index 0246664c..0ebcb579 100644 --- a/src/app/app-modules/pharmacist/worklist/worklist.component.ts +++ b/src/app/app-modules/pharmacist/worklist/worklist.component.ts @@ -148,6 +148,9 @@ export class WorklistComponent implements OnInit, OnDestroy, DoCheck { } }, (err) => { + if (err?.handled) { + return; + } this.confirmationService.alert(err, 'error'); }, ); From bc2878a22bc8e608d685e947f226b0b59e4af228 Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Thu, 11 Dec 2025 23:05:46 +0530 Subject: [PATCH 2/3] fix: amm-1931 clearing the session --- src/app/app-modules/core/services/http-interceptor.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/app-modules/core/services/http-interceptor.service.ts b/src/app/app-modules/core/services/http-interceptor.service.ts index 1a151b81..b1240478 100644 --- a/src/app/app-modules/core/services/http-interceptor.service.ts +++ b/src/app/app-modules/core/services/http-interceptor.service.ts @@ -107,6 +107,8 @@ export class HttpInterceptorService implements HttpInterceptor { 'error', ); } + sessionStorage.clear(); + this.sessionstorage.clear(); return throwError(error.error); }), ); From ae5873217c93a0bd12dac578f16c6705a0efcc55 Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Fri, 12 Dec 2025 10:21:33 +0530 Subject: [PATCH 3/3] fix: amm-1931 navigating to login page on expiry --- .../core/services/http-interceptor.service.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/app-modules/core/services/http-interceptor.service.ts b/src/app/app-modules/core/services/http-interceptor.service.ts index b1240478..4fcb5b6d 100644 --- a/src/app/app-modules/core/services/http-interceptor.service.ts +++ b/src/app/app-modules/core/services/http-interceptor.service.ts @@ -89,22 +89,23 @@ export class HttpInterceptorService implements HttpInterceptor { this.spinnerService.setLoading(false); if (error.status === 401) { this.handleSessionExpiry( - this.currentLanguageSet.sessionExpiredPleaseLogin, + this.currentLanguageSet.sessionExpiredPleaseLogin || + 'Session has expired, please login again.', ); } else if (error.status === 403) { - this.confirmationService.alert( - this.currentLanguageSet.accessDenied, - 'error', + this.handleSessionExpiry( + this.currentLanguageSet.accessDenied || + 'Access Denied. You do not have permission to access this resource.', ); } else if (error.status === 500) { - this.confirmationService.alert( + this.handleSessionExpiry( this.currentLanguageSet.internaleServerError, - 'error', ); } else { - this.confirmationService.alert( - error.message || this.currentLanguageSet.somethingWentWrong, - 'error', + this.handleSessionExpiry( + error.message || + this.currentLanguageSet.somethingWentWrong || + 'Something went wrong. Please try again later.', ); } sessionStorage.clear();