Skip to content

Commit 6800545

Browse files
owenizeddCopilot
andauthored
Update lib/pause.js
Add try/catch Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9f9f9e4 commit 6800545

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/pause.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ 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(JSON.stringify(val, null, 2)))
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+
}
179183
}
180184

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

0 commit comments

Comments
 (0)