Skip to content

Fixed "TypeError: invalid data" when executables run by exec exited with non-zero code.#1500

Merged
mhegazy merged 1 commit into
microsoft:masterfrom
Arnavion:exec-process-stderr-number
Dec 16, 2014
Merged

Fixed "TypeError: invalid data" when executables run by exec exited with non-zero code.#1500
mhegazy merged 1 commit into
microsoft:masterfrom
Arnavion:exec-process-stderr-number

Conversation

@Arnavion

Copy link
Copy Markdown
Contributor

The original error was because process.stderr only allows writing Strings or Buffers, but status is a Number.

Also, the message parameter of the "error" handler is just the amalgam of all output written to stderr. This is already logged by the "stderr" handler, so there's no need to write it to process.stderr again.

Before:

> jake generate-code-coverage


  17 failing
jake aborted.
TypeError: invalid data
    at WriteStream.Socket.write (net.js:614:11)
    at null.<anonymous> (C:\Stuff\Sources\TypeScript\Jakefile:450:24)
(See full trace by running task with --trace)
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

After:

> jake generate-code-coverage


  17 failing
Process exited with code 17

…ith non-zero code.

The original error was because process.stderr only allows writing Strings or Buffers, but status is a Number.

Also, the message parameter of the "error" handler is just the amalgam of all output written to stderr. This is already logged by the "stderr" handler, so there's no need to write it to process.stderr again.
@mhegazy

mhegazy commented Dec 16, 2014

Copy link
Copy Markdown
Contributor

thanks!

mhegazy added a commit that referenced this pull request Dec 16, 2014
Fixed "TypeError: invalid data" when executables run by exec exited with non-zero code.
@mhegazy mhegazy merged commit 5c4c08a into microsoft:master Dec 16, 2014
@Arnavion Arnavion deleted the exec-process-stderr-number branch December 16, 2014 18:11
@Arnavion

Copy link
Copy Markdown
Contributor Author

A side effect of this change is that Travis builds won't fail any more for broken tests, because the "error" handler calls complete() instead of fail(). Before this change it would throw the TypeError before it could call complete() so it would fail for that reason. I will make a new pullreq to fix that.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants