Skip to content

feat: more descriptive error when childProcess.spawn fails - #888

Merged
Dirk Bäumer (dbaeumer) merged 2 commits into
microsoft:mainfrom
dsherret:more_descriptive_spawn_error
Feb 4, 2022
Merged

feat: more descriptive error when childProcess.spawn fails#888
Dirk Bäumer (dbaeumer) merged 2 commits into
microsoft:mainfrom
dsherret:more_descriptive_spawn_error

Conversation

@dsherret

Copy link
Copy Markdown
Contributor

Closes #887

Comment thread client/src/node/main.ts
return new Promise<MessageTransports>((_, reject) => {
process.on("error", (err) => {
reject(`${message} ${err}`);
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://nodejs.org/api/child_process.html#event-error

It's unfortunate that this is an event instead of it just being thrown from spawn.

@dbaeumer Dirk Bäumer (dbaeumer) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest looks good to me. Thanks for providing this.

Comment thread client/src/node/main.ts Outdated
}

return new Promise<MessageTransports>((_, reject) => {
process.on("error", (err) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing: we use single quotes for constant string values (e.g. 'error')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider improving error message when launching process fails

2 participants