Code Monkey home page Code Monkey logo

Comments (4)

Meowhal avatar Meowhal commented on May 31, 2024

I am frustrated that javascript can throw objects that are not errors.
I always got tired of thinking about it and did it in a perfunctory way.

If you would be willing to write a PR I would welcome it.

from osu-ahr.

Meowhal avatar Meowhal commented on May 31, 2024

It may be redundant to include Error in our message since log4js shows ERROR.

logger.error(`${e.message}\n${e.stack}`);
[ERROR]: Couldn't eat the fruit, apple was rotten
// long error stack

from osu-ahr.

xayanide avatar xayanide commented on May 31, 2024

It may be redundant to include Error in our message since log4js shows ERROR.

In that case, it was indeed redundant, that was an example just in case there was a string like for another example:

  logger.error(`@Class#Method\n${e.message}\n${e.stack}`);
[ERROR]: @Class#Method
Couldn't eat the fruit, apple was rotten
// long error stack

or maybe, another considerable way without \n after the string.
I think the first way is much more readable than this second one below speaking of the output.

  logger.error(`@Class#Method ${e.message}\n${e.stack}`);
[ERROR]: @Class#Method Couldn't eat the fruit, apple was rotten
// long error stack

from osu-ahr.

Meowhal avatar Meowhal commented on May 31, 2024

Oh, I am sorry that I took it wrong. I just wrote what came to mind.

@Class#Method would be a useful keyword when searching.
I like the pattern where the first line contains only metadata.
logger.error(@Class#Method\n${e.message}\n${e.stack});

It will be difficult to sort out the error messages, as I have written them in an inconsistent manner.
If you can't handle it, let me know.

from osu-ahr.

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.