@withone/cli 1.44.0 → 1.44.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.
Files changed (2) hide show
  1. package/dist/index.js +17 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6273,17 +6273,23 @@ async function syncModel(api, profile, options) {
6273
6273
  if (lock) lock.release();
6274
6274
  const rawMsg = err instanceof Error ? err.message : String(err);
6275
6275
  const shortMsg = truncate(rawMsg, 500);
6276
+ const httpStatus = err instanceof ApiError ? err.status : void 0;
6277
+ const retryAfter = err instanceof ApiError ? err.retryAfterSeconds : void 0;
6276
6278
  if (pagesProcessed > 0) {
6277
6279
  const resumeErr = new Error(
6278
6280
  `Sync interrupted after page ${pagesProcessed} (${totalRecords} records). Run again to resume. Error: ${shortMsg}`
6279
6281
  );
6280
6282
  resumeErr._recordsSynced = totalRecords;
6281
6283
  resumeErr._pagesProcessed = pagesProcessed;
6284
+ resumeErr._httpStatus = httpStatus;
6285
+ resumeErr._retryAfter = retryAfter;
6282
6286
  throw resumeErr;
6283
6287
  }
6284
6288
  const wrapped = new Error(shortMsg);
6285
6289
  wrapped._recordsSynced = totalRecords;
6286
6290
  wrapped._pagesProcessed = pagesProcessed;
6291
+ wrapped._httpStatus = httpStatus;
6292
+ wrapped._retryAfter = retryAfter;
6287
6293
  throw wrapped;
6288
6294
  } finally {
6289
6295
  process.off("SIGINT", onSigint);
@@ -7762,13 +7768,18 @@ async function syncRunCommand(platform, options) {
7762
7768
  results.push(result);
7763
7769
  } catch (err) {
7764
7770
  const errObj = err;
7771
+ const errorContext = {
7772
+ message: err instanceof Error ? err.message : String(err),
7773
+ ...errObj?._httpStatus !== void 0 ? { httpStatus: errObj._httpStatus } : {},
7774
+ ...errObj?._retryAfter !== void 0 ? { retryAfter: errObj._retryAfter } : {}
7775
+ };
7765
7776
  results.push({
7766
7777
  model: profile.model,
7767
7778
  recordsSynced: errObj?._recordsSynced ?? 0,
7768
7779
  pagesProcessed: errObj?._pagesProcessed ?? 0,
7769
7780
  duration: "0s",
7770
7781
  status: "failed",
7771
- error: err instanceof Error ? err.message : String(err)
7782
+ error: errorContext
7772
7783
  });
7773
7784
  }
7774
7785
  }
@@ -7787,8 +7798,11 @@ async function syncRunCommand(platform, options) {
7787
7798
  const archivedColor = sc.archived > sc.active ? pc9.red : pc9.dim;
7788
7799
  console.log(` memory: ${pc9.green(String(sc.active))} active, ${archivedColor(String(sc.archived))} archived`);
7789
7800
  }
7790
- if ("error" in r && r.error) {
7791
- console.log(` ${pc9.red(r.error)}`);
7801
+ if (r.error) {
7802
+ const errParts = [r.error.message];
7803
+ if (r.error.httpStatus) errParts.push(`HTTP ${r.error.httpStatus}`);
7804
+ if (r.error.retryAfter) errParts.push(`retry after ${r.error.retryAfter}s`);
7805
+ console.log(` ${pc9.red(errParts.join(" \u2014 "))}`);
7792
7806
  }
7793
7807
  }
7794
7808
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.44.0",
3
+ "version": "1.44.1",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [