@archbase/core 4.0.35 → 4.0.37
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.
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -3018,15 +3018,18 @@ function processErrorMessage(error) {
|
|
|
3018
3018
|
msgErro = t("archbase:metodo_nao_permitido");
|
|
3019
3019
|
} else if (error.response && error.response.status && error.response.status === 400) {
|
|
3020
3020
|
msgErro = `${error.response?.data?.message ?? (error.response?.data && typeof error.response?.data === "string" ? error.response.data : t("archbase:dados_incorretos"))}`;
|
|
3021
|
+
} else if (error.response && error.response.status && error.response.status === 403) {
|
|
3022
|
+
msgErro = t("archbase:acesso_negado");
|
|
3021
3023
|
} else if (error.response && error.response.status && error.response.status === 500) {
|
|
3022
3024
|
msgErro = t("archbase:erro_servidor", {
|
|
3023
3025
|
path: error.response.data.path,
|
|
3024
3026
|
message: error.response.data.message
|
|
3025
3027
|
});
|
|
3026
3028
|
} else if (error.response && error.response.data) {
|
|
3027
|
-
|
|
3029
|
+
const data = error.response.data;
|
|
3030
|
+
msgErro = typeof data === "string" ? data : data?.detail || data?.message || data?.title || data?.error || JSON.stringify(data);
|
|
3028
3031
|
} else if (error.response) {
|
|
3029
|
-
msgErro = error.response;
|
|
3032
|
+
msgErro = error.response.statusText || String(error.response.status);
|
|
3030
3033
|
} else if (error.message && error.message === "Network Error") {
|
|
3031
3034
|
msgErro = t("archbase:servidor_nao_disponivel");
|
|
3032
3035
|
} else if (error.message) {
|
|
@@ -3037,6 +3040,8 @@ function processErrorMessage(error) {
|
|
|
3037
3040
|
if (typeof msgErro === "object") {
|
|
3038
3041
|
if (error && (error.code === "ERR_NETWORK" || error.message === "Network Error")) {
|
|
3039
3042
|
msgErro = t("archbase:servidor_nao_disponivel");
|
|
3043
|
+
} else {
|
|
3044
|
+
msgErro = JSON.stringify(msgErro);
|
|
3040
3045
|
}
|
|
3041
3046
|
}
|
|
3042
3047
|
return `${msgErro}`;
|