From 225dec76278cb8d6cf1a79f3cfacc722b94f2fd5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 28 Mar 2023 21:57:59 -0500 Subject: [PATCH] io: print line before rethrowing error --- src/io.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/io.ts b/src/io.ts index 5303d3e..cf8f6ec 100644 --- a/src/io.ts +++ b/src/io.ts @@ -8,7 +8,12 @@ import type { InputMessage, OutputMessage } from './types.ts'; */ async function* readStdin(): AsyncGenerator { for await (const line of readLines(Deno.stdin)) { - yield JSON.parse(line); + try { + yield JSON.parse(line); + } catch (e) { + console.error(line); + throw e; + } } }