@fiber-pay/runtime 0.1.0-rc.6 → 0.1.0-rc.7
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 +52 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2168,12 +2168,60 @@ var HealthMonitor = class extends BaseMonitor {
|
|
|
2168
2168
|
|
|
2169
2169
|
// src/monitors/tracker-utils.ts
|
|
2170
2170
|
function isNotFoundError(error) {
|
|
2171
|
-
const
|
|
2172
|
-
return /not found|does not exist|no such/i.test(
|
|
2171
|
+
const haystack = collectErrorText(error);
|
|
2172
|
+
return /not found|does not exist|no such/i.test(haystack);
|
|
2173
2173
|
}
|
|
2174
2174
|
function isExpectedTrackerError(error) {
|
|
2175
|
-
const
|
|
2176
|
-
return /temporarily unavailable|connection refused|timed out|timeout/i.test(
|
|
2175
|
+
const haystack = collectErrorText(error);
|
|
2176
|
+
return /temporarily unavailable|connection refused|timed out|timeout/i.test(haystack);
|
|
2177
|
+
}
|
|
2178
|
+
function collectErrorText(error) {
|
|
2179
|
+
if (error === null || error === void 0) {
|
|
2180
|
+
return "";
|
|
2181
|
+
}
|
|
2182
|
+
const parts = [];
|
|
2183
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2184
|
+
const walk = (value, depth) => {
|
|
2185
|
+
if (value === null || value === void 0) {
|
|
2186
|
+
return;
|
|
2187
|
+
}
|
|
2188
|
+
if (depth > 4) {
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
if (typeof value === "string") {
|
|
2192
|
+
parts.push(value);
|
|
2193
|
+
return;
|
|
2194
|
+
}
|
|
2195
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
2196
|
+
parts.push(String(value));
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
if (typeof value !== "object") {
|
|
2200
|
+
return;
|
|
2201
|
+
}
|
|
2202
|
+
if (seen.has(value)) {
|
|
2203
|
+
return;
|
|
2204
|
+
}
|
|
2205
|
+
seen.add(value);
|
|
2206
|
+
if (value instanceof Error) {
|
|
2207
|
+
parts.push(value.message);
|
|
2208
|
+
const valueWithData = value;
|
|
2209
|
+
walk(valueWithData.data, depth + 1);
|
|
2210
|
+
walk(valueWithData.cause, depth + 1);
|
|
2211
|
+
return;
|
|
2212
|
+
}
|
|
2213
|
+
if (Array.isArray(value)) {
|
|
2214
|
+
for (const item of value) {
|
|
2215
|
+
walk(item, depth + 1);
|
|
2216
|
+
}
|
|
2217
|
+
return;
|
|
2218
|
+
}
|
|
2219
|
+
for (const nested of Object.values(value)) {
|
|
2220
|
+
walk(nested, depth + 1);
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
walk(error, 0);
|
|
2224
|
+
return parts.join(" ");
|
|
2177
2225
|
}
|
|
2178
2226
|
|
|
2179
2227
|
// src/monitors/invoice-tracker.ts
|