Skip to content

Commit d42f131

Browse files
committed
improve logging
1 parent 7245654 commit d42f131

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ export function createUpdateBlockTool<T>(config: {
143143
const block = editor.getBlock(id);
144144

145145
if (!block) {
146-
// eslint-disable-next-line no-console
147-
console.error("BLOCK NOT FOUND", id);
148146
return {
149147
ok: false,
150-
error: "block not found",
148+
error: new Error("Block not found (update)", {
149+
cause: {
150+
blockId: id,
151+
},
152+
}),
151153
};
152154
}
153155

packages/xl-ai/src/api/formats/base-tools/delete.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export const deleteBlockTool = (
6262
if (!block) {
6363
return {
6464
ok: false,
65-
error: "block not found",
65+
error: new Error("Block not found (delete)", {
66+
cause: {
67+
blockId: id,
68+
},
69+
}),
6670
};
6771
}
6872

0 commit comments

Comments
 (0)