richie-education 2.28.2-dev66 → 2.29.1-dev32
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.
|
@@ -96,12 +96,17 @@ const LyraPopIn = ({
|
|
|
96
96
|
const handleFormError = async (error: KRError) => {
|
|
97
97
|
// Do not close the pop-in if the error is a invalid data error (CLIENT_3XX).
|
|
98
98
|
// https://docs.lyra.com/fr/rest/V4.0/javascript/features/js_error_management.html#client004
|
|
99
|
-
|
|
99
|
+
const { errorCode, errorMessage, detailedErrorMessage } = error;
|
|
100
|
+
// Since the latest version of Lyra SDK released on 20/08/2024,
|
|
101
|
+
// the error code CLIENT_106 is raised when the user closes the pop-in so with our
|
|
102
|
+
// current implementation it triggers an infinite loop...
|
|
103
|
+
// A patch from Lyra is planned, until that we have to ignore this error.
|
|
104
|
+
if (!errorCode.startsWith('CLIENT_3') && !['CLIENT_106'].includes(errorCode)) {
|
|
100
105
|
shouldAbort.current = false;
|
|
101
106
|
await KR.closePopin(formId);
|
|
102
|
-
let errorMessages =
|
|
103
|
-
if (
|
|
104
|
-
errorMessages += `: ${
|
|
107
|
+
let errorMessages = errorMessage;
|
|
108
|
+
if (detailedErrorMessage) {
|
|
109
|
+
errorMessages += `: ${detailedErrorMessage}`;
|
|
105
110
|
}
|
|
106
111
|
handleError(errorMessages);
|
|
107
112
|
}
|