fix: only append ellipsis when string exceeds 100 chars

This commit is contained in:
Kenny 2026-01-12 22:03:15 -05:00
parent 04ae3642d9
commit 864656475a

View File

@ -192,7 +192,7 @@ export function createClaudeCodeHooksHook(
} catch (e) {
throw new Error(
`[todowrite ERROR] Failed to parse todos string as JSON. ` +
`Received: ${output.args.todos.slice(0, 100)}... ` +
`Received: ${output.args.todos.length > 100 ? output.args.todos.slice(0, 100) + '...' : output.args.todos} ` +
`Expected: Valid JSON array. Pass todos as an array, not a string.`
)
}