@hmcts/opal-frontend-common 0.0.75 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,9 +10,11 @@ const ERROR_RESPONSE = {
|
|
|
10
10
|
|
|
11
11
|
const GENERIC_HTTP_ERROR_MESSAGE = 'You can try again. If the problem persists, contact the service desk.';
|
|
12
12
|
|
|
13
|
+
const GENERIC_HTTP_ERROR_TITLE = 'There was a problem';
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* Generated bundle index. Do not edit.
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
|
-
export { ERROR_RESPONSE, GENERIC_HTTP_ERROR_MESSAGE };
|
|
19
|
+
export { ERROR_RESPONSE, GENERIC_HTTP_ERROR_MESSAGE, GENERIC_HTTP_ERROR_TITLE };
|
|
18
20
|
//# sourceMappingURL=hmcts-opal-frontend-common-interceptors-http-error-constants.mjs.map
|
|
@@ -7,6 +7,8 @@ import { GLOBAL_ERROR_STATE } from '@hmcts/opal-frontend-common/stores/global/co
|
|
|
7
7
|
|
|
8
8
|
const GENERIC_HTTP_ERROR_MESSAGE = 'You can try again. If the problem persists, contact the service desk.';
|
|
9
9
|
|
|
10
|
+
const GENERIC_HTTP_ERROR_TITLE = 'There was a problem';
|
|
11
|
+
|
|
10
12
|
const ERROR_RESPONSE = {
|
|
11
13
|
type: null,
|
|
12
14
|
title: null,
|
|
@@ -56,7 +58,7 @@ function handleRetriableError(error, globalStore) {
|
|
|
56
58
|
globalStore.setBannerError({
|
|
57
59
|
...GLOBAL_ERROR_STATE,
|
|
58
60
|
error: true,
|
|
59
|
-
title: errorResponse?.title ||
|
|
61
|
+
title: errorResponse?.title || GENERIC_HTTP_ERROR_TITLE,
|
|
60
62
|
message: errorMessage,
|
|
61
63
|
operationId: errorResponse?.operation_id || ERROR_RESPONSE.operation_id,
|
|
62
64
|
});
|
|
@@ -141,7 +143,7 @@ const httpErrorInterceptor = (req, next) => {
|
|
|
141
143
|
globalStore.setBannerError({
|
|
142
144
|
...GLOBAL_ERROR_STATE,
|
|
143
145
|
error: true,
|
|
144
|
-
title:
|
|
146
|
+
title: GENERIC_HTTP_ERROR_TITLE,
|
|
145
147
|
message: GENERIC_HTTP_ERROR_MESSAGE,
|
|
146
148
|
operationId: ERROR_RESPONSE.operation_id,
|
|
147
149
|
});
|
package/package.json
CHANGED
|
@@ -4,4 +4,6 @@ declare const ERROR_RESPONSE: IErrorResponse;
|
|
|
4
4
|
|
|
5
5
|
declare const GENERIC_HTTP_ERROR_MESSAGE = "You can try again. If the problem persists, contact the service desk.";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
declare const GENERIC_HTTP_ERROR_TITLE = "There was a problem";
|
|
8
|
+
|
|
9
|
+
export { ERROR_RESPONSE, GENERIC_HTTP_ERROR_MESSAGE, GENERIC_HTTP_ERROR_TITLE };
|