diff --git a/src/controllers/frontend.ts b/src/controllers/frontend.ts index 45c63c3d..6e39a266 100644 --- a/src/controllers/frontend.ts +++ b/src/controllers/frontend.ts @@ -60,7 +60,8 @@ export const frontendController: AppMiddleware = async (c, next) => { try { const meta = metadataView(await buildTemplateOpts(params, Conf.local(c.req.path))); return c.html(content.replace(META_PLACEHOLDER, meta)); - } catch { + } catch (e) { + console.debug(e); return c.html(content); } } diff --git a/src/utils/og-metadata.ts b/src/utils/og-metadata.ts index 0d7a1e61..956d855d 100644 --- a/src/utils/og-metadata.ts +++ b/src/utils/og-metadata.ts @@ -3,9 +3,12 @@ import { getEvent } from '@/queries.ts'; import { nip19, nip27 } from 'nostr-tools'; import { match } from 'path-to-regexp'; +import { Stickynotes } from '@soapbox/stickynotes'; import { lookupAccount, lookupPubkey } from '@/utils/lookup.ts'; import { parseAndVerifyNip05 } from '@/utils/nip05.ts'; +const console = new Stickynotes('ditto:frontend'); + export interface OpenGraphTemplateOpts { title: string; type: 'article' | 'profile' | 'website'; @@ -78,6 +81,7 @@ type ProfileInfo = { name: string; about: string } & NostrMetadata; * or sensible defaults if the kind 0 has those values missing. */ export async function getProfileInfo(handle: string | undefined): Promise { + console.debug(handle); const acc = await lookupAccount(handle || ''); if (!acc) throw new Error('Invalid handle specified, or account not found.');