Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 209 Vote(s) - 3.74 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What properties does Node.js express's Error object expose?

#1
I would like to know what are the functions that the Error object of nodejs express exposes for use in error handling?


A `console.log` of an error call `new Error('NotFound')` is showing only `[Error: NotFound]`.
Is this because the `.toString()` method is overriden?
How do I find the properties and functions exposed by these objects?
Reply

#2
The `Error` object is actually a native object provided by `V8`, rather than by `node.js` or `express`.

The property that will most likely be of the most use to you is `stack`. E.g.,

console.log(new Error('NotFound').stack);

There are other properties available as well, such as `name` and `message`. You can read up on them [here](

[To see links please register here]

). Just be aware that those docs are for Mozilla's JavaScript engine, so don't count on anything flagged as `Non-standard` to work in `node.js`.
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through