Giter VIP home page Giter VIP logo

Comments (2)

papb avatar papb commented on May 18, 2024 1

Hello, thank you for the fast reply. No, the log option wouldn't work for me; I have already caught the error within a try-catch block.

However, I decided I don't really need this for now, so don't worry about it :)

from log-process-errors.

ehmicky avatar ehmicky commented on May 18, 2024

Hi @papb 👋

At the moment, the logic related to error formatting is not decoupled from the logic related to error handling, so you would need to handle the errors using log-process-errors to benefit from the error formatting.

One thing to keep in mind is that the error formatting needs not only the error instance, but also any properties passed to the process event. For example, in process.on('unhandledPromise', (error, promise) => {...}, both error and promise are printed by the error formatter (since they are both interesting). So if we were to decouple error formatting, users would need to pass those arguments along as well. Although we could make those additional arguments optional (but the output will be less informative).

Decoupling the formatting logic is not completely straightforward though, so I'd like to ask you: would the log option be a solution for you? This would require you to catch the error using log-process-errors, but you would still be able to run your custom logic.

from log-process-errors.

Related Issues (11)

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.