Coder Social home page Coder Social logo

`reject` option about execa HOT 5 CLOSED

sindresorhus avatar sindresorhus commented on September 24, 2024
`reject` option

from execa.

Comments (5)

sindresorhus avatar sindresorhus commented on September 24, 2024 2

Are we having it as a parameter so that we can control this functionality?

Yes, read the issue title.

Maybe just {reject: false}.

from execa.

mbad0la avatar mbad0la commented on September 24, 2024

Why can't we use the catch method upon rejection of our promises? That can be used to display results such as linter issues. Am I missing out on something?

from execa.

sindresorhus avatar sindresorhus commented on September 24, 2024

@mbad0la That works, but it's more verbose when using async functions as you need to wrap it in a try/catch. Example:

execa/test.js

Lines 26 to 30 in 9345d2c

try {
await m('./fixtures/error-message.js');
} catch (err) {
t.true(err.message.indexOf('stdout') !== -1);
}

from execa.

mbad0la avatar mbad0la commented on September 24, 2024

@sindresorhus I get it and I do support this functionality. Are we having it as a parameter so that we can control this functionality?
Btw, What do you think about the name overrideReject? Personally, the rejection is not an error as we might get our desired behaviour through catch as I mentioned earlier. So having the word Error in the option is maybe not that correct. What do you think about this?

from execa.

mbad0la avatar mbad0la commented on September 24, 2024

My bad, sorry about the question. reject works with me.

from execa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.