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 b39d4a93..70821bef 100644 --- a/src/app/app-modules/core/services/http-interceptor.service.ts +++ b/src/app/app-modules/core/services/http-interceptor.service.ts @@ -76,6 +76,26 @@ export class HttpInterceptorService implements HttpInterceptor { catchError((error: HttpErrorResponse) => { console.error(error); this.spinnerService.setLoading(false); + if (error.status === 401) { + this.handleSessionExpiry( + this.currentLanguageSet.sessionExpiredPleaseLogin, + ); + } else if (error.status === 403) { + this.confirmationService.alert( + this.currentLanguageSet.accessDenied, + 'error', + ); + } else if (error.status === 500) { + this.confirmationService.alert( + this.currentLanguageSet.internaleServerError, + 'error', + ); + } else { + this.confirmationService.alert( + error.message || this.currentLanguageSet.somethingWentWrong, + 'error', + ); + } return throwError(error.error); }), ); diff --git a/src/assets/English.json b/src/assets/English.json index 327cb96e..c23717a3 100644 --- a/src/assets/English.json +++ b/src/assets/English.json @@ -2115,7 +2115,10 @@ "abhaNumberAlreadyWith": "The Abha number is already linked with beneficiary ID - ", "issueInFetchinglinkedBeneficiaryId": "Issue in fetching Beneficiary Id linked to ABHA ID", "sessionExpiredPleaseLogin": "Session expired. Please log in again to continue", - "continueButton": "Continue" + "continueButton": "Continue", + "accessDenied": "Access Denied", + "internaleServerError": "Internal Server Error", + "somethingWentWrong": "Something went wrong" } diff --git a/src/assets/Hindi.json b/src/assets/Hindi.json index 3522f967..bd514cd9 100644 --- a/src/assets/Hindi.json +++ b/src/assets/Hindi.json @@ -2110,6 +2110,9 @@ "abhaNumberAlreadyWith": "The Abha number is already linked with beneficiary ID - ", "issueInFetchinglinkedBeneficiaryId": "Issue in fetching Beneficiary Id linked to ABHA ID", "sessionExpiredPleaseLogin": "Session expired. Please log in again to continue", - "continueButton": "जारी रखें" + "continueButton": "जारी रखें", + "accessDenied": "पहुँच अस्वीकृत", + "internaleServerError": "आंतरिक सर्वर त्रुटि", + "somethingWentWrong": "कुछ गलत हो गया" } } diff --git a/src/assets/Kannada.json b/src/assets/Kannada.json index f329c215..5feb4ec6 100644 --- a/src/assets/Kannada.json +++ b/src/assets/Kannada.json @@ -2131,7 +2131,10 @@ "abhaNumberAlreadyWith": "The Abha number is already linked with beneficiary ID - ", "issueInFetchinglinkedBeneficiaryId": "Issue in fetching Beneficiary Id linked to ABHA ID", "sessionExpiredPleaseLogin": "Session expired. Please log in again to continue", - "continueButton": "ಮುಂದುವರಿಸಿ" + "continueButton": "ಮುಂದುವರಿಸಿ", + "accessDenied": "ಪ್ರವೇಶ ನಿರಾಕರಿಸಲಾಗಿದೆ", + "internaleServerError": "ಆಂತರಿಕ ಸರ್ವರ್ ದೋಷ", + "somethingWentWrong": "ಏನೋ ತಪ್ಪಾಗಿದೆ" }