@eleboucher/pi-memini 0.5.8 → 0.5.10
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 +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -229,8 +229,12 @@ function createClient(cfg, warn) {
|
|
|
229
229
|
signal: AbortSignal.timeout(cfg.timeout_ms),
|
|
230
230
|
});
|
|
231
231
|
if (!res.ok) {
|
|
232
|
-
if (cfg.fallback_on_error)
|
|
232
|
+
if (cfg.fallback_on_error) {
|
|
233
|
+
// Degrade but never silently: a swallowed 401/500 on a capture or
|
|
234
|
+
// recall looks like "memory isn't working" with nothing to debug.
|
|
235
|
+
warn(`memini ${method} ${path} failed: ${res.status}`);
|
|
233
236
|
return null;
|
|
237
|
+
}
|
|
234
238
|
const text = await res.text().catch(() => "");
|
|
235
239
|
throw new Error(`memini ${method} ${path} failed: ${res.status} ${text}`);
|
|
236
240
|
}
|