@moveris/shared 3.3.0 → 3.3.1
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/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1298,6 +1298,10 @@ function getApiErrorMessage(code, message, customMessages) {
|
|
|
1298
1298
|
if (code) {
|
|
1299
1299
|
const custom = customMessages?.[code];
|
|
1300
1300
|
if (custom) return custom;
|
|
1301
|
+
if (code === API_ERROR_CODES.MISSING_FIELD && message && !looksLikeRawData(message)) {
|
|
1302
|
+
const field = message.replace(" is required", "").trim();
|
|
1303
|
+
if (field) return `Missing required field: ${field} \u2014 please try again`;
|
|
1304
|
+
}
|
|
1301
1305
|
const known = ERROR_MESSAGES[code];
|
|
1302
1306
|
if (known) return known;
|
|
1303
1307
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1155,6 +1155,10 @@ function getApiErrorMessage(code, message, customMessages) {
|
|
|
1155
1155
|
if (code) {
|
|
1156
1156
|
const custom = customMessages?.[code];
|
|
1157
1157
|
if (custom) return custom;
|
|
1158
|
+
if (code === API_ERROR_CODES.MISSING_FIELD && message && !looksLikeRawData(message)) {
|
|
1159
|
+
const field = message.replace(" is required", "").trim();
|
|
1160
|
+
if (field) return `Missing required field: ${field} \u2014 please try again`;
|
|
1161
|
+
}
|
|
1158
1162
|
const known = ERROR_MESSAGES[code];
|
|
1159
1163
|
if (known) return known;
|
|
1160
1164
|
}
|