From a0d006a1acc4c6a0759cc123a18e0197f7c76374 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 14 Dec 2023 17:55:35 -0600 Subject: Log post creation failures (#2205) --- src/lib/api/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/api/index.ts') diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index d94ee4643..440dfa5ee 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -104,12 +104,18 @@ export async function post(agent: BskyAgent, opts: PostOpts) { // add image embed if present if (opts.images?.length) { + logger.info(`Uploading images`, { + count: opts.images.length, + }) + const images: AppBskyEmbedImages.Image[] = [] for (const image of opts.images) { opts.onStateChange?.(`Uploading image #${images.length + 1}...`) + logger.info(`Compressing image`) await image.compress() const path = image.compressed?.path ?? image.path const {width, height} = image.compressed || image + logger.info(`Uploading image`) const res = await uploadBlob(agent, path, 'image/jpeg') images.push({ image: res.data.blob, -- cgit 1.4.1