Commit b765f11c0d

b765f11c0d2d9644c808cf9e6afedd86aef24a19

parent: b656b7100c

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-01 05:44 UTC

Use format strings in console.error calls

Ref #4

Layout: unified · split

src/index.ts +3 −3
@@ -102,7 +102,7 @@ export default {
102102 message.ack();
103103 } catch (err) {
104104 const job = message.body;
105 console.error(`Export ${job.jobId} failed:`, err);
105 console.error("Export %s failed:", job.jobId, err);
106106 try {
107107 await env.DB.prepare(
108108 "UPDATE exports SET status = 'error', error = ?1, completed_at = ?2 WHERE id = ?3",
@@ -112,7 +112,7 @@ export default {
112112 } catch (recordErr) {
113113 // Recording the failure must not stop the ack below, or a
114114 // deterministic render error would be retried to the DLQ limit.
115 console.error(`Could not record export failure for ${job.jobId}:`, recordErr);
115 console.error("Could not record export failure for %s:", job.jobId, recordErr);
116116 }
117117 // Rendering failure is deterministic (bad data / bug), not transient —
118118 // don't retry, the error is recorded for the operator.
@@ -665,7 +665,7 @@ async function handleResync(request: Request, env: Env): Promise<Response> {
665665 try {
666666 await pollInstallation(env, session.installationId, summary);
667667 } catch (err) {
668 console.error(`Resync failed for installation ${session.installationId}:`, err);
668 console.error("Resync failed for installation %s:", session.installationId, err);
669669 }
670670 return Response.redirect(new URL("/", request.url).toString(), 303);
671671}