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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user