@archbase/core 4.0.19 → 4.0.20
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/dist/archbase-core-4.0.20.tgz +0 -0
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/archbase-core-4.0.19.tgz +0 -0
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -3001,12 +3001,15 @@ function processErrorMessage(error) {
|
|
|
3001
3001
|
if (error && error.response && error.response.status && error.response.status === 401 || error && error.status && error.status === 401) {
|
|
3002
3002
|
return t("archbase:Usuário/senha não encontrados. Não autorizado.");
|
|
3003
3003
|
}
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3004
|
+
const apiError = error?.response?.data?.apierror ?? error?.response?.data;
|
|
3005
|
+
const fieldErrorList = apiError?.subErrors ?? apiError?.fieldErrors;
|
|
3006
|
+
if (apiError && (fieldErrorList || apiError.message)) {
|
|
3007
|
+
msgErro = apiError.message;
|
|
3008
|
+
if (fieldErrorList) {
|
|
3007
3009
|
msgErro = [];
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
+
fieldErrorList.forEach((element) => {
|
|
3011
|
+
const fieldName = element.field ?? element.property;
|
|
3012
|
+
msgErro.push(`(${fieldName}) ${element.message}`);
|
|
3010
3013
|
});
|
|
3011
3014
|
}
|
|
3012
3015
|
} else if (error.response && error.response.status && error.response.status === 404) {
|
|
@@ -3040,8 +3043,9 @@ function processErrorMessage(error) {
|
|
|
3040
3043
|
}
|
|
3041
3044
|
function processDetailErrorMessage(error) {
|
|
3042
3045
|
let msgErro = "";
|
|
3043
|
-
|
|
3044
|
-
|
|
3046
|
+
const apiError = error?.response?.data?.apierror ?? error?.response?.data;
|
|
3047
|
+
if (apiError?.debugMessage) {
|
|
3048
|
+
msgErro = apiError.debugMessage;
|
|
3045
3049
|
}
|
|
3046
3050
|
return `${msgErro}`;
|
|
3047
3051
|
}
|