eversince 0.2.15 → 0.2.16
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/client.js +6 -3
- package/dist/commands/run.js +2 -0
- package/dist/source.sha256 +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -261,12 +261,15 @@ export class Client {
|
|
|
261
261
|
}
|
|
262
262
|
const aborted = error instanceof Error && error.name === 'AbortError';
|
|
263
263
|
const connectFailure = !aborted && (isConnectFailure(error) || error instanceof RenewalUnreachable);
|
|
264
|
+
const unknownOutcome = isWrite && !connectFailure;
|
|
264
265
|
const wrapped = new ApiError(0, {
|
|
265
266
|
code: aborted ? 'timeout' : 'network_error',
|
|
266
|
-
message: aborted
|
|
267
|
-
? `Timed out after ${Math.round((options.timeoutMs ?? this.defaultTimeoutMs) / 1000)}s calling ${url.pathname}
|
|
268
|
-
: `Could not reach ${url.host}: ${error instanceof Error ? error.message : String(error)}
|
|
267
|
+
message: (aborted
|
|
268
|
+
? `Timed out after ${Math.round((options.timeoutMs ?? this.defaultTimeoutMs) / 1000)}s calling ${url.pathname}.`
|
|
269
|
+
: `Could not reach ${url.host}: ${error instanceof Error ? error.message : String(error)}.`)
|
|
270
|
+
+ (unknownOutcome ? ' The request may have been applied before the connection dropped.' : ''),
|
|
269
271
|
retryable: isWrite ? connectFailure : true,
|
|
272
|
+
...(unknownOutcome ? { suggested_action: 'Read the current state (get_timeline, get_items, get_jobs) to see whether it was applied before sending it again.' } : {}),
|
|
270
273
|
});
|
|
271
274
|
const canRetry = attempt < maxAttempts - 1 && (isWrite ? connectFailure : true);
|
|
272
275
|
if (!canRetry)
|
package/dist/commands/run.js
CHANGED
|
@@ -92,6 +92,8 @@ export async function run(argv, connection, mode) {
|
|
|
92
92
|
const answered = await client.toolWithMedia(argv.name, input, { idempotencyKey: argv.idempotencyKey });
|
|
93
93
|
const saved = await saveMedia(answered.media, argv.name, argv.out);
|
|
94
94
|
const pictures = saved.filter((p) => !!p);
|
|
95
|
+
if (argv.out && !pictures.length)
|
|
96
|
+
note('--out saves pictures; this call returned none, so nothing was written there.');
|
|
95
97
|
const drawn = pictures.length ? { ...withPicturePaths(answered.data, saved), pictures } : answered.data;
|
|
96
98
|
const result = answered.cloudProcessing && drawn && typeof drawn === 'object' && !Array.isArray(drawn)
|
|
97
99
|
? { ...drawn, cloud_processing: answered.cloudProcessing }
|
package/dist/source.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a11529fec7c8973acd0eb530c9fe9763e095386748d999d47db443dc948d877b
|
package/package.json
CHANGED