@openmrs/esm-form-engine-lib 2.1.0-pre.1438 → 2.1.0-pre.1442
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.
package/package.json
CHANGED
@@ -127,9 +127,18 @@ export const FormFactoryProvider: React.FC<FormFactoryProviderProps> = ({
|
|
127
127
|
handleClose();
|
128
128
|
}
|
129
129
|
})
|
130
|
-
.catch((
|
130
|
+
.catch((errorObject: Error | ToastDescriptor) => {
|
131
131
|
setIsSubmitting(false);
|
132
|
-
|
132
|
+
if (errorObject instanceof Error) {
|
133
|
+
showToast({
|
134
|
+
title: t('errorProcessingFormSubmission', 'Error processing form submission'),
|
135
|
+
kind: 'error',
|
136
|
+
description: errorObject.message,
|
137
|
+
critical: true,
|
138
|
+
});
|
139
|
+
} else {
|
140
|
+
showToast(errorObject);
|
141
|
+
}
|
133
142
|
});
|
134
143
|
} else {
|
135
144
|
setIsSubmitting(false);
|