Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Stop burying stderr output within exec #78

Closed
wants to merge 1 commit into from

Conversation

dandean
Copy link
Contributor

@dandean dandean commented Jan 30, 2020

The exec util buries stderr output. This makes it difficult to understand why your script is failing.

Example: Here's how it currently works. Notice there is nothing specific about what went wrong in the error output:

npm run storybook:publish -- --bucket-path=XXXXXXXXXXXXXX

=> Building storybook for: web
   executing: build-storybook  -o out8599
=> Deploying storybook
   executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX

/......../node_modules/@storybook/storybook-deployer/src/utils.js:19
  throw new Error(
  ^

Error: Exec code(255) on executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX
undefined

Result: Here's what happens with this patch:

npm run storybook:publish -- --bucket-path=XXXXXXXXXXXXXX

=> Building storybook for: web
   executing: build-storybook  -o out8599
=> Deploying storybook
   executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX

The config profile (default) could not be found

/......../node_modules/@storybook/storybook-deployer/src/utils.js:19
  throw new Error(
  ^

Error: Exec code(255) on executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX
undefined

We can now see the source of the error as indicated by the command which we executed:

The config profile (default) could not be found

@dandean dandean self-assigned this Jan 30, 2020
The exec util buries stderr output. This makes it difficult to understand why your script is failing.

Example: Here's how it currently works. Notice there is nothing specific about what went wrong in the error output:

```sh
npm run storybook:publish -- --bucket-path=XXXXXXXXXXXXXX

=> Building storybook for: web
   executing: build-storybook  -o out8599
=> Deploying storybook
   executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX

/......../node_modules/@storybook/storybook-deployer/src/utils.js:19
  throw new Error(
  ^

Error: Exec code(255) on executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX
undefined
```

Result: Here's what happens with this patch:

```sh
npm run storybook:publish -- --bucket-path=XXXXXXXXXXXXXX

=> Building storybook for: web
   executing: build-storybook  -o out8599
=> Deploying storybook
   executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX

The config profile (default) could not be found

/......../node_modules/@storybook/storybook-deployer/src/utils.js:19
  throw new Error(
  ^

Error: Exec code(255) on executing: aws --profile default s3 sync out8599 s3://XXXXXXXXXXXXXX
undefined
```

We can now see the source of the error as indicated by the command which we executed:

> The config profile (default) could not be found
@dandean dandean force-pushed the dandean/expose-stderr-output branch from edaa0ec to 31669c5 Compare January 30, 2020 00:15
@dandean
Copy link
Contributor Author

dandean commented Jan 30, 2020

Actually, this is a duplicate of #73.

Notable that these patches would make debugging current issues like #77 and #63 easier.

@dandean dandean closed this Jan 30, 2020
@dandean dandean deleted the dandean/expose-stderr-output branch January 30, 2020 00:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

1 participant