@arker-ai/sdk 0.1.0 → 0.1.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.
- package/dist/index.cjs +7 -3
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -133,7 +133,7 @@ var Arker = class {
|
|
|
133
133
|
payload = null;
|
|
134
134
|
}
|
|
135
135
|
lastStatus = resp.status;
|
|
136
|
-
lastText = text;
|
|
136
|
+
lastText = text.trim();
|
|
137
137
|
const envelopeErr = payload && typeof payload === "object" && payload.ok === false ? payload.error : null;
|
|
138
138
|
lastErr = envelopeErr;
|
|
139
139
|
if (RETRYABLE_HTTP.has(resp.status) || isTransient(envelopeErr)) {
|
|
@@ -145,14 +145,18 @@ var Arker = class {
|
|
|
145
145
|
throw new ArkerError(envelopeErr.code ?? "internal", envelopeErr.message ?? "", resp.status);
|
|
146
146
|
}
|
|
147
147
|
if (resp.status >= 400) {
|
|
148
|
-
throw new ArkerError("internal",
|
|
148
|
+
throw new ArkerError("internal", lastText.slice(0, 200) || `HTTP ${resp.status}`, resp.status);
|
|
149
149
|
}
|
|
150
150
|
return payload;
|
|
151
151
|
}
|
|
152
152
|
if (lastErr) {
|
|
153
153
|
throw new ArkerError(lastErr.code ?? "internal", lastErr.message ?? "", lastStatus);
|
|
154
154
|
}
|
|
155
|
-
throw new ArkerError(
|
|
155
|
+
throw new ArkerError(
|
|
156
|
+
"internal",
|
|
157
|
+
lastText.slice(0, 200) || `HTTP ${lastStatus} after ${MAX_ATTEMPTS} attempts`,
|
|
158
|
+
lastStatus
|
|
159
|
+
);
|
|
156
160
|
}
|
|
157
161
|
/** Open a handle to a VM by ULID *or* template name. No network call. */
|
|
158
162
|
vm(vmId) {
|
package/dist/index.js
CHANGED
|
@@ -102,7 +102,7 @@ var Arker = class {
|
|
|
102
102
|
payload = null;
|
|
103
103
|
}
|
|
104
104
|
lastStatus = resp.status;
|
|
105
|
-
lastText = text;
|
|
105
|
+
lastText = text.trim();
|
|
106
106
|
const envelopeErr = payload && typeof payload === "object" && payload.ok === false ? payload.error : null;
|
|
107
107
|
lastErr = envelopeErr;
|
|
108
108
|
if (RETRYABLE_HTTP.has(resp.status) || isTransient(envelopeErr)) {
|
|
@@ -114,14 +114,18 @@ var Arker = class {
|
|
|
114
114
|
throw new ArkerError(envelopeErr.code ?? "internal", envelopeErr.message ?? "", resp.status);
|
|
115
115
|
}
|
|
116
116
|
if (resp.status >= 400) {
|
|
117
|
-
throw new ArkerError("internal",
|
|
117
|
+
throw new ArkerError("internal", lastText.slice(0, 200) || `HTTP ${resp.status}`, resp.status);
|
|
118
118
|
}
|
|
119
119
|
return payload;
|
|
120
120
|
}
|
|
121
121
|
if (lastErr) {
|
|
122
122
|
throw new ArkerError(lastErr.code ?? "internal", lastErr.message ?? "", lastStatus);
|
|
123
123
|
}
|
|
124
|
-
throw new ArkerError(
|
|
124
|
+
throw new ArkerError(
|
|
125
|
+
"internal",
|
|
126
|
+
lastText.slice(0, 200) || `HTTP ${lastStatus} after ${MAX_ATTEMPTS} attempts`,
|
|
127
|
+
lastStatus
|
|
128
|
+
);
|
|
125
129
|
}
|
|
126
130
|
/** Open a handle to a VM by ULID *or* template name. No network call. */
|
|
127
131
|
vm(vmId) {
|
package/package.json
CHANGED