Skip to content

Commit

Permalink
Merge pull request #1808 from prisma/introspection-handle-disconnected
Browse files Browse the repository at this point in the history
fix(#1728) Handle disconnected error for introspection engine
  • Loading branch information
timsuchanek committed Mar 10, 2020
2 parents 228540f + 3e3adcd commit 701690f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli/sdk/src/IntrospectionEngine.ts
Expand Up @@ -365,6 +365,13 @@ export class IntrospectionEngine {
}
}
})
if (this.child!.stdin!.destroyed) {
throw new Error(
`Can't execute ${JSON.stringify(
request,
)} because introspection engine is destroyed.`,
)
}
debugRpc('SENDING RPC CALL', JSON.stringify(request))
this.child!.stdin!.write(JSON.stringify(request) + '\n')
this.lastRequest = request
Expand Down

0 comments on commit 701690f

Please sign in to comment.