Skip to content

Commit

Permalink
fix an issue with deno
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw authored and zhusjfaker committed Mar 28, 2022
1 parent 18c9c16 commit 45332ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/deno/mod.ts
Expand Up @@ -224,15 +224,15 @@ let ensureServiceIsRunning = (): Promise<Service> => {
const stdoutBuffer = new Uint8Array(4 * 1024 * 1024)
const readMoreStdout = () => child.stdout.read(stdoutBuffer).then(n => {
if (n === null) {
afterClose()
afterClose(null)
} else {
readFromStdout(stdoutBuffer.subarray(0, n))
readMoreStdout()
}
}).catch(e => {
if (e instanceof Deno.errors.Interrupted || e instanceof Deno.errors.BadResource) {
// ignore the error if read was interrupted (stdout was closed)
afterClose()
afterClose(e)
} else {
throw e;
}
Expand Down

0 comments on commit 45332ae

Please sign in to comment.