Comments (4)
Might it be better to do:
Contents Of Original Error Message:
stdout:
head 1
head 2
...
tail -2
tail -1
sterr:
head 1
head 2
...
tail -2
tail -1
And have an error.originalMessage
property.
from execa.
It's to get good error messages when exit code is non-zero. I sometimes got empty errors when the relevant error was printed on stdout. I like your suggestion. Let's go with it.
Is this providing any real value? If people want to log it to the console, can't they just:
Sure, but when using async functions you first have to try/catch it and then console.log the properties. That's very interrupting for your flow.
With most errors the stdout/stderr output is minimal.
from execa.
Mostly, when spawning native binaries (like I do in imagemin) you'll get the real errors on stderr
(or in bad cases stdout
) and err.message
just contains spawn ERRCODE
and gives you no valuable info. I have to do like this to circumvent it https://github.com/imagemin/imagemin-gifsicle/blob/067cea4948a6709ad9f39813ed912222e9d5966e/index.js#L32-L33.
from execa.
Closing as it's better to be verbose on failure.
from execa.
Related Issues (20)
- Not able to inject environment variables HOT 3
- Node.js engine version in package.json is not up-to-date HOT 6
- Document CLI utilities
- Subprocess is considered as failed exit when using `process.kill` on windows only HOT 6
- Graceful termination HOT 1
- Document idiomatic ternary interpolation pattern? HOT 2
- TypeError: The "eventTargets" argument must be an instance of EventEmitter or EventTarget. Received an instance of AbortSignal HOT 7
- Feature request: Possibility to use a custom verbose log format? HOT 5
- stdout/stderr with 'inherit' + transform should not capture output HOT 2
- Unable to extend env when `ProcessEnv` has been manipulated HOT 7
- Typescript: Verbose option type mismatch? HOT 2
- Memory Leak of pipe HOT 3
- `parseCommandString()` splits at whitespace inside quotes HOT 3
- Timeout / cancel stuck process HOT 4
- The command cannot be executed HOT 1
- Intl needed for v. 9 HOT 10
- Error: Premature close HOT 23
- Small package alternative to Execa HOT 9
- Add a link to `nano-spawn`
- How to get both live and programmatic output? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from execa.