Skip to content

Commit

Permalink
fix(gatsby): catch error from this.process.send (#32356)
Browse files Browse the repository at this point in the history
Co-authored-by: Ward Peeters <[email protected]>
(cherry picked from commit 99936a8)
  • Loading branch information
KyleAMathews authored and LekoArts committed Jul 16, 2021
1 parent 4f9a724 commit 6a6a4bb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/gatsby/src/commands/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ class ControllableScript {
}

this.isRunning = false
if (signal) {
try {
try {
if (signal) {
this.process.kill(signal)
} catch (err) {
// Ignore error if process has crashed
// Ref: https://github.com/gatsbyjs/gatsby/issues/28011#issuecomment-877302917
} else {
this.process.send({
type: `COMMAND`,
action: {
type: `EXIT`,
payload: code,
},
})
}
} else {
this.process.send({
type: `COMMAND`,
action: {
type: `EXIT`,
payload: code,
},
})
} catch (err) {
// Ignore error if process has crashed or already quit.
// Ref: https://github.com/gatsbyjs/gatsby/issues/28011#issuecomment-877302917
}

return new Promise(resolve => {
Expand Down

0 comments on commit 6a6a4bb

Please sign in to comment.