We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9c308c commit 93975c0Copy full SHA for 93975c0
components/kustomer/common/utils.mjs
@@ -28,7 +28,10 @@ export const parseObject = (obj) => {
28
export const throwError = (message) => {
29
const parsedMessage = JSON.parse(message);
30
const error = parsedMessage.errors[0];
31
- const errorParameter = error.meta.subErrors[0].source.pointer || error.source.parameter;
32
- const errorMessage = error.detail || error.meta.subErrors[0].title;
+ const errorParameter =
+ error.source.parameter ||
33
+ error.source.pointer ||
34
+ error.meta?.subErrors[0]?.source?.pointer;
35
+ const errorMessage = error.detail || error.title || error.meta?.subErrors[0]?.title;
36
throw new ConfigurationError(`${errorParameter} - ${errorMessage}`);
37
};
0 commit comments