Skip to content

Commit 256e525

Browse files
owenizeddCopilotkobenguyent
authored
feat: better I.grab logging in live interactive mode (#4986)
* feat: better I.grab logging * Update lib/pause.js Add try/catch Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/pause.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent 11c2d1c commit 256e525

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/pause.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ async function parseInput(cmd) {
175175
output.print(output.styles.success(' OK '), cmd)
176176
}
177177
if (cmd?.startsWith('I.grab')) {
178-
output.print(output.styles.debug(val))
178+
try {
179+
output.print(output.styles.debug(JSON.stringify(val, null, 2)))
180+
} catch (err) {
181+
output.print(output.styles.error(' ERROR '), 'Failed to stringify result:', err.message)
182+
output.print(output.styles.error(' RAW VALUE '), String(val))
183+
}
179184
}
180185

181186
history.push(cmd) // add command to history when successful

0 commit comments

Comments
 (0)