@agentproto/catalog-sync 0.6.1 → 0.6.3

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.mjs CHANGED
@@ -180,6 +180,13 @@ async function runGenerators(gens, opts) {
180
180
  ...src.body !== void 0 ? { body: JSON.stringify(src.body) } : {}
181
181
  });
182
182
  if (!res.ok) {
183
+ if (existing !== void 0) {
184
+ process.stderr.write(
185
+ `catalog-sync: skipping refresh of "${src.id}" \u2014 fetch ${src.url} failed: ${res.status} ${res.statusText}; reusing committed snapshot.
186
+ `
187
+ );
188
+ return JSON.parse(existing);
189
+ }
183
190
  throw new Error(
184
191
  `catalog-sync: fetch ${src.url} failed: ${res.status} ${res.statusText}`
185
192
  );