ardent-cli 0.0.53 → 0.0.54
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 +27 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1469,14 +1469,32 @@ var EngineSetupTimeoutError = class extends Error {
|
|
|
1469
1469
|
};
|
|
1470
1470
|
var EngineSetupOperationFailedError = class extends Error {
|
|
1471
1471
|
operationError;
|
|
1472
|
-
|
|
1472
|
+
connectorId;
|
|
1473
|
+
connectorName;
|
|
1474
|
+
operationId;
|
|
1475
|
+
constructor(operationError, connectorIdOrName, connectorName, operationId) {
|
|
1476
|
+
const recoveryHandle = connectorName && operationId ? `${engineSetupRecoveryHandle(connectorIdOrName, connectorName, operationId)} ` : "";
|
|
1477
|
+
const retryName = connectorName ?? connectorIdOrName;
|
|
1473
1478
|
super(
|
|
1474
|
-
`Engine setup failed: ${operationError ?? "unknown error"}. Inspect connector state with \`ardent connector list\`, then retry with \`ardent connector retry-setup ${
|
|
1479
|
+
`Engine setup failed: ${operationError ?? "unknown error"}. ` + recoveryHandle + `Inspect connector state with \`ardent connector list\`, then retry with \`ardent connector retry-setup ${retryName}\` once the underlying issue is resolved.`
|
|
1475
1480
|
);
|
|
1476
1481
|
this.name = "EngineSetupOperationFailedError";
|
|
1477
1482
|
this.operationError = operationError;
|
|
1483
|
+
this.connectorId = connectorName ? connectorIdOrName : null;
|
|
1484
|
+
this.connectorName = connectorName ?? connectorIdOrName;
|
|
1485
|
+
this.operationId = operationId ?? null;
|
|
1478
1486
|
}
|
|
1479
1487
|
};
|
|
1488
|
+
function engineSetupRecoveryHandle(connectorId, connectorName, operationId) {
|
|
1489
|
+
return `For recovery, reference operation id ${operationId} for connector ${connectorId} (${connectorName}).`;
|
|
1490
|
+
}
|
|
1491
|
+
function formatNextEngineSetupPollAction(pollIntervalMs) {
|
|
1492
|
+
if (pollIntervalMs <= 0) {
|
|
1493
|
+
return "The next check runs immediately";
|
|
1494
|
+
}
|
|
1495
|
+
const nextPollSeconds = Math.ceil(pollIntervalMs / 1e3);
|
|
1496
|
+
return `The next check runs in ${nextPollSeconds}s`;
|
|
1497
|
+
}
|
|
1480
1498
|
async function runEngineSetupWithPolling(connectorId, connectorName, options = {}) {
|
|
1481
1499
|
let dispatch;
|
|
1482
1500
|
try {
|
|
@@ -1511,7 +1529,7 @@ async function runEngineSetupWithPolling(connectorId, connectorName, options = {
|
|
|
1511
1529
|
consecutiveTransientFailures += 1;
|
|
1512
1530
|
if (consecutiveTransientFailures % ENGINE_SETUP_TRANSIENT_WARN_EVERY === 0) {
|
|
1513
1531
|
console.warn(
|
|
1514
|
-
` \u26A0 Status check has failed ${consecutiveTransientFailures} times in a row. Setup is still running server-side and the CLI will keep waiting \u2014 do NOT delete the connector.`
|
|
1532
|
+
` \u26A0 Status check has failed ${consecutiveTransientFailures} times in a row. ${engineSetupRecoveryHandle(connectorId, connectorName, operationId)} Setup is still running server-side and the CLI will keep waiting \u2014 do NOT delete the connector. ${formatNextEngineSetupPollAction(pollIntervalMs)}; if this continues, contact Ardent support with that operation id.`
|
|
1515
1533
|
);
|
|
1516
1534
|
}
|
|
1517
1535
|
continue;
|
|
@@ -1532,7 +1550,12 @@ async function runEngineSetupWithPolling(connectorId, connectorName, options = {
|
|
|
1532
1550
|
return { dispatched: true };
|
|
1533
1551
|
}
|
|
1534
1552
|
if (op.status === "failed") {
|
|
1535
|
-
throw new EngineSetupOperationFailedError(
|
|
1553
|
+
throw new EngineSetupOperationFailedError(
|
|
1554
|
+
op.error,
|
|
1555
|
+
connectorId,
|
|
1556
|
+
connectorName,
|
|
1557
|
+
operationId
|
|
1558
|
+
);
|
|
1536
1559
|
}
|
|
1537
1560
|
}
|
|
1538
1561
|
throw new EngineSetupTimeoutError(
|