Skip to content

Commit

Permalink
fix(gatsby): catch error from this.process.send (#32356) (#32387)
Browse files Browse the repository at this point in the history
Co-authored-by: Ward Peeters <ward@coding-tech.com>
(cherry picked from commit 99936a8)

Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
  • Loading branch information
GatsbyJS Bot and KyleAMathews committed Jul 16, 2021
1 parent ba0050a commit 0ae10bf
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/gatsby/src/commands/develop.ts
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 0ae10bf

Please sign in to comment.