Skip to content
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
21 changes: 12 additions & 9 deletions src/app/app-modules/core/services/http-interceptor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,27 @@ 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();
this.sessionstorage.clear();
return throwError(error.error);
}),
);
Expand Down
3 changes: 3 additions & 0 deletions src/app/app-modules/lab/worklist/worklist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export class WorklistComponent implements OnInit, OnDestroy, DoCheck {
}
},
(err) => {
if (err?.handled) {
return;
}
this.confirmationService.alert(err, 'error');
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
);
Expand Down
3 changes: 3 additions & 0 deletions src/app/app-modules/pharmacist/worklist/worklist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ export class WorklistComponent implements OnInit, OnDestroy, DoCheck {
}
},
(err) => {
if (err?.handled) {
return;
}
this.confirmationService.alert(err, 'error');
},
);
Expand Down