io: print line before rethrowing error
This commit is contained in:
parent
c087e8fddd
commit
225dec7627
@ -8,7 +8,12 @@ import type { InputMessage, OutputMessage } from './types.ts';
|
|||||||
*/
|
*/
|
||||||
async function* readStdin(): AsyncGenerator<InputMessage> {
|
async function* readStdin(): AsyncGenerator<InputMessage> {
|
||||||
for await (const line of readLines(Deno.stdin)) {
|
for await (const line of readLines(Deno.stdin)) {
|
||||||
|
try {
|
||||||
yield JSON.parse(line);
|
yield JSON.parse(line);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(line);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user