ardent-cli 0.0.47 → 0.0.48
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 +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1153,17 +1153,18 @@ var DiscoveryTimeoutError = class extends Error {
|
|
|
1153
1153
|
};
|
|
1154
1154
|
var DiscoveryOperationFailedError = class extends Error {
|
|
1155
1155
|
operationError;
|
|
1156
|
-
constructor(operationError) {
|
|
1156
|
+
constructor(operationError, recoveryGuidance) {
|
|
1157
1157
|
super(
|
|
1158
|
-
`Discovery failed: ${operationError ?? "unknown error"}. Inspect the connector with \`ardent connector list\`, fix the underlying issue, then
|
|
1158
|
+
`Discovery failed: ${operationError ?? "unknown error"}. Inspect the connector with \`ardent connector list\`, fix the underlying issue, then ${recoveryGuidance}.`
|
|
1159
1159
|
);
|
|
1160
1160
|
this.name = "DiscoveryOperationFailedError";
|
|
1161
1161
|
this.operationError = operationError;
|
|
1162
1162
|
}
|
|
1163
1163
|
};
|
|
1164
1164
|
async function runDiscoveryWithPolling(connectorId, options) {
|
|
1165
|
-
const maxWaitMs = options
|
|
1166
|
-
const pollIntervalMs = options
|
|
1165
|
+
const maxWaitMs = options.maxWaitMs ?? 10 * 60 * 1e3;
|
|
1166
|
+
const pollIntervalMs = options.pollIntervalMs ?? 3 * 1e3;
|
|
1167
|
+
const recoveryGuidance = options.recoveryGuidance;
|
|
1167
1168
|
let dispatch;
|
|
1168
1169
|
try {
|
|
1169
1170
|
dispatch = await api.post(
|
|
@@ -1178,7 +1179,7 @@ async function runDiscoveryWithPolling(connectorId, options) {
|
|
|
1178
1179
|
}
|
|
1179
1180
|
throw err;
|
|
1180
1181
|
}
|
|
1181
|
-
if (options
|
|
1182
|
+
if (options.onPrerequisites) {
|
|
1182
1183
|
options.onPrerequisites(dispatch.prerequisites, dispatch.source_metadata);
|
|
1183
1184
|
}
|
|
1184
1185
|
const operationId = dispatch.operation_id;
|
|
@@ -1210,7 +1211,7 @@ async function runDiscoveryWithPolling(connectorId, options) {
|
|
|
1210
1211
|
};
|
|
1211
1212
|
}
|
|
1212
1213
|
if (op.status === "failed") {
|
|
1213
|
-
throw new DiscoveryOperationFailedError(op.error);
|
|
1214
|
+
throw new DiscoveryOperationFailedError(op.error, recoveryGuidance);
|
|
1214
1215
|
}
|
|
1215
1216
|
}
|
|
1216
1217
|
throw new DiscoveryTimeoutError(
|
|
@@ -2205,6 +2206,7 @@ async function createAction2(type, url, options) {
|
|
|
2205
2206
|
let discoverPollResult;
|
|
2206
2207
|
try {
|
|
2207
2208
|
discoverPollResult = await runDiscoveryWithPolling(connectorId, {
|
|
2209
|
+
recoveryGuidance: `delete the connector with \`ardent connector delete ${connectorName}\`, then run \`ardent connector create\` again`,
|
|
2208
2210
|
onPrerequisites: (prereqs) => {
|
|
2209
2211
|
if (prereqs.pass) {
|
|
2210
2212
|
console.log("Connected \u2713 \u2014 scanning your schema\u2026");
|