@ai-matrx/records-ui 0.116.44 → 0.116.46
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/CHANGELOG.md +36 -1
- package/dist/{SaveToTable-EGBEB5WG.js → SaveToTable-SWB2ZN5X.js} +3 -3
- package/dist/{chunk-CV4D2BZY.js → chunk-UTMV5ES2.js} +5 -5
- package/dist/{chunk-CV4D2BZY.js.map → chunk-UTMV5ES2.js.map} +1 -1
- package/dist/{chunk-KP2R7LVO.js → chunk-Y5QOV3XA.js} +79 -76
- package/dist/chunk-Y5QOV3XA.js.map +1 -0
- package/dist/{chunk-KEILC5XG.js → chunk-ZUQUZOL5.js} +43 -20
- package/dist/chunk-ZUQUZOL5.js.map +1 -0
- package/dist/helpers.cjs +6 -4
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +6 -4
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +2392 -2332
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +240 -210
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +565 -538
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-KEILC5XG.js.map +0 -1
- package/dist/chunk-KP2R7LVO.js.map +0 -1
- /package/dist/{SaveToTable-EGBEB5WG.js.map → SaveToTable-SWB2ZN5X.js.map} +0 -0
package/dist/helpers.js
CHANGED
|
@@ -1049,23 +1049,25 @@ function exampleOf(error) {
|
|
|
1049
1049
|
const example = detail.example;
|
|
1050
1050
|
return typeof example === "string" && example.trim() !== "" ? example.trim() : null;
|
|
1051
1051
|
}
|
|
1052
|
+
var TIMED_OUT_SAID = "This took too long. Please try again.";
|
|
1052
1053
|
function refusalForAPerson(error) {
|
|
1053
1054
|
const code = error.code ?? "internal";
|
|
1055
|
+
const timedOut = code === "timed_out" || error.sqlstate === "57014" || /canceling statement due to statement timeout/i.test(String(error.message ?? ""));
|
|
1054
1056
|
const ours = error.ours === true;
|
|
1055
1057
|
const hint = plainSentence(String(error.hint ?? ""));
|
|
1056
1058
|
const message = ours ? plainSentence(String(error.message ?? "")) : peopleSentence(String(error.message ?? ""));
|
|
1057
|
-
const title = TITLE[code] ?? "That was refused";
|
|
1059
|
+
const title = timedOut ? TITLE["timed_out"] : TITLE[code] ?? "That was refused";
|
|
1058
1060
|
const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
|
|
1059
1061
|
const example = exampleOf(error);
|
|
1060
|
-
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? REMEDY[code] ?? REMEDY["internal"];
|
|
1062
|
+
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
|
|
1061
1063
|
const messageIsForEngineers = isEngineerText(String(error.message ?? ""));
|
|
1062
|
-
const said = (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
1064
|
+
const said = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? "" : message.kept ?? "").trim();
|
|
1063
1065
|
const forEngineers = [
|
|
1064
1066
|
error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,
|
|
1065
1067
|
// The client's own note about a class it did not recognize, or a call that
|
|
1066
1068
|
// never reached the store. It is rendered out of sight, never as a sentence.
|
|
1067
1069
|
error.diagnostic ? error.diagnostic : null,
|
|
1068
|
-
messageIsForEngineers ? `Message: ${error.message}` : null,
|
|
1070
|
+
messageIsForEngineers || timedOut ? `Message: ${error.message}` : null,
|
|
1069
1071
|
error.hint && (hintIsForEngineers || hint.kept !== error.hint) ? `Hint: ${error.hint}` : null,
|
|
1070
1072
|
message.dropped.length > 0 || hint.dropped.length > 0 ? `Dropped from the person's view: ${[...message.dropped, ...hint.dropped].join(" | ")}` : null
|
|
1071
1073
|
].filter(Boolean).join(" ");
|