From 21c4339cb14c9f17a8dc31cdbfc67a6cb34f6e5b Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 15 Dec 2019 23:55:10 +0100 Subject: [PATCH] Add more documentation about `error.message` --- index.d.ts | 4 +++- readme.md | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 17b155372a..76a20bfb38 100644 --- a/index.d.ts +++ b/index.d.ts @@ -336,7 +336,9 @@ declare namespace execa { extends Error, ExecaReturnBase { /** - The error message. + Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored. + + The child process stderr then stdout are appended to the end, separated with newlines and not interleaved. */ message: string; diff --git a/readme.md b/readme.md index 603677b412..68d59863ae 100644 --- a/readme.md +++ b/readme.md @@ -304,11 +304,19 @@ A human-friendly description of the signal that was used to terminate the proces If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen. +#### message + +Type: `string` + +Error message when the child process failed to run. In addition to the [underlying error message](#originalMessage), it also contains some information related to why the child process errored. + +The child process [stderr](#stderr) then [stdout](#stdout) are appended to the end, separated with newlines and not interleaved. + #### shortMessage Type: `string` -This is the same as the `message` property except it does not include the child process stdout/stderr. +This is the same as the [`message` property](#message) except it does not include the child process stdout/stderr. #### originalMessage