From 9fcd10be326380ee1921ad4acd275eb4e7e52084 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 16 Jun 2025 14:19:16 -0500 Subject: [PATCH] Comments --- bskyogcard/src/routes/post.tsx | 5 ++++- bskyogcard/src/util/postDisplayOptions.ts | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bskyogcard/src/routes/post.tsx b/bskyogcard/src/routes/post.tsx index c0c2fe4223..ce488f4fd4 100644 --- a/bskyogcard/src/routes/post.tsx +++ b/bskyogcard/src/routes/post.tsx @@ -89,7 +89,10 @@ export default function (ctx: AppContext, app: Express) { return res.end(output.asPng()) } catch (err) { - httpLogger.warn({err, uri: uri.toString()}, 'could not fetch post') + httpLogger.warn( + {err, uri: uri.toString()}, + `Failed to render post ${uri}`, + ) return res.status(404).end('not found') } }), diff --git a/bskyogcard/src/util/postDisplayOptions.ts b/bskyogcard/src/util/postDisplayOptions.ts index 6ae38007df..32d3698560 100644 --- a/bskyogcard/src/util/postDisplayOptions.ts +++ b/bskyogcard/src/util/postDisplayOptions.ts @@ -4,6 +4,9 @@ import {getWidthWithMat} from './frameMatting.js' export const DEFAULT_WIDTH = 360 +/** + * Options parsed from the query string, passed to the components themselves. + */ export type DisplayOptions = { mat: boolean } @@ -25,6 +28,10 @@ export function parseDisplayOptionsFromQuery(query: ParsedQs): DisplayOptions { return opts } +/** + * Options computed from the parsed query options, passed to the render + * function. + */ export function getRenderOptions(options: DisplayOptions) { return { // must match width + padding of Post.tsx