Merge branch 'dev' of https://git.lincpay.tech/CBSNexora/cbsnexora into dev
build-run / Run Lint, Build and Deploy (push) Canceled after 0s
Publish Image in Docker Hub / build (push) Canceled after 0s
Tests / testRigor (push) Canceled after 0s
Playwright E2E Tests / Run Playwright Tests (push) Canceled after 0s

# Conflicts:
#	src/environments/.env.ts
This commit is contained in:
2026-08-11 12:45:52 +05:30
77 changed files with 10045 additions and 1129 deletions
+6
View File
@@ -12,4 +12,10 @@
export interface Alert {
type: string;
message: string;
/**
* Errors are shown as a centred modal that has to be dismissed, because a corner toast that
* disappears on its own is too easy to miss for something the user has to act on. Anything
* without this keeps the unobtrusive snack bar.
*/
severity?: 'error';
}
+20 -24
View File
@@ -88,42 +88,38 @@ export class ErrorHandlerInterceptor implements HttpInterceptor {
throw response;
}
// Resolved once and emitted in one place below, so every failure here is consistently tagged
// as an error and therefore surfaces as a centred modal rather than a corner toast.
let alert: { type: string; message: string } | null = null;
if (status === 401 || (environment.oauth.enabled && status === 400)) {
this.alertService.alert({ type: 'Authentication Error', message: 'Invalid User Details. Please try again!' });
alert = { type: 'Authentication Error', message: 'Invalid User Details. Please try again!' };
} else if (status === 403 && errorMessage === 'The provided one time token is invalid') {
this.alertService.alert({ type: 'Invalid Token', message: 'Invalid Token. Please try again!' });
alert = { type: 'Invalid Token', message: 'Invalid Token. Please try again!' };
} else if (status === 400) {
this.alertService.alert({
type: 'Bad Request',
message: errorMessage || 'Invalid parameters were passed in the request!'
});
alert = { type: 'Bad Request', message: errorMessage || 'Invalid parameters were passed in the request!' };
} else if (status === 403) {
this.alertService.alert({
type: 'Unauthorized Request',
message: errorMessage || 'You are not authorized for this request!'
});
alert = { type: 'Unauthorized Request', message: errorMessage || 'You are not authorized for this request!' };
} else if (status === 404) {
{
this.alertService.alert({
type: this.translate.instant('error.resource.not.found'),
message: errorMessage || 'Resource does not exist!'
});
}
alert = {
type: this.translate.instant('error.resource.not.found'),
message: errorMessage || 'Resource does not exist!'
};
} else if (status === 500) {
this.alertService.alert({
type: 'Internal Server Error',
message: 'Internal Server Error. Please try again later.'
});
alert = { type: 'Internal Server Error', message: 'Internal Server Error. Please try again later.' };
} else if (status === 501) {
this.alertService.alert({
alert = {
type: this.translate.instant('error.resource.notImplemented.type'),
message: this.translate.instant('error.resource.notImplemented.message')
});
};
} else if (status === 503) {
this.alertService.alert({
alert = {
type: 'Service Unavailable',
message: errorMessage || 'The server is currently unable to handle the request. Please try after some time.'
});
};
}
if (alert) {
this.alertService.alert({ ...alert, severity: 'error' });
}
throw response;