feat(blog): wire instrumentation — repo spans + use-case/controller withSpan + logger capture

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-07 00:18:13 +02:00
parent 64b6eb79d4
commit 5903cef70a
8 changed files with 506 additions and 111 deletions

View File

@@ -62,7 +62,10 @@ function buildPayloadStub() {
findByID: vi.fn(
async ({ id }: { collection: string; id: string; overrideAccess?: boolean }) => {
const doc = store.get(String(id));
if (!doc) throw new Error(`Not found: ${id}`);
if (!doc) {
const err = Object.assign(new Error(`Not found: ${id}`), { status: 404 });
throw err;
}
return doc;
},
),
@@ -77,7 +80,10 @@ function buildPayloadStub() {
overrideAccess?: boolean;
}) => {
const existing = store.get(String(id));
if (!existing) throw new Error(`Not found: ${id}`);
if (!existing) {
const err = Object.assign(new Error(`Not found: ${id}`), { status: 404 });
throw err;
}
const updated = { ...existing, ...data };
store.set(String(id), updated);
return updated;